Php data types
<?php
$name = "Umar sheik";
$food = "egg";
$age = 19;
$gpa = 8.5;
$price = 5.88;
$online = true;
echo "{$name} like {$food}<br>";
echo "you are {$age} years old<br>";
echo "your gpa is {$gpa}<br>";
echo "your egg is \${$price}<br>";
echo "online status <b>{$online}</b> if false nothing
displays";
?>
GET AND POST METHOD
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,
initial-scale=1.0">
<title>get and post</title>
</head>
<body>
<form action="index.php" method="post">
<label>Username : </label><br>
<input type="text" name="username"><br>
<label>password : </label><br>
<input type="password" name="pass"><br>
<input type="submit" value="Log in"><br>
</form>
</body>
</html>
<?php
echo "{$_POST["username"]} <br>";
echo $_POST["pass"];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,
initial-scale=1.0">
<title>get and post</title>
</head>
<body>
<form action="index.php" method="post">
<label>Quantity : </label><br>
<input type="text" name="quantity"><br>
<input type="submit" value="total"><br>
</form>
</body>
</html>
<?php
$item = "apple";
$price = 21.43;
$quantity = $_POST["quantity"];
$total = null;
$total = $quantity * $price;
echo "you have ordered {$quantity} x {$item}/s<br>";
echo "Your total is : {$total}"
?>
Math functions
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,
initial-scale=1.0">
<title>get and post</title>
</head>
<body>
<form action="index.php" method="post">
<label>X : </label><br>
<input type="text" name="x"><br>
<label>Y : </label><br>
<input type="text" name="y"><br>
<label>Z : </label><br>
<input type="text" name="z"><br>
<input type="submit" value="total"><br>
</form>
</body>
</html>
<?php
$x = $_POST["x"];
$y = $_POST["y"];
$y = $_POST["z"];
$total = null;
$total = abs($x);
$total = round($x);
$total = floor($x);
$total = ceil($x);
$total = sqrt($x);
$total = pow($x, $y);
$total = max($x, $y, $z);
$total = min($x, $y, $z);
$total = pi();
$total = rand(1, 6);
echo $x;
?>