1. variables and data types
- $ : used to represent variables
- strings
- integers
- float
- booleans
<?php
$name = "Shivam";
$age = 21;
$gpa = 9.8
$eligible = false;
echo"Hello {$name}<br>";
echo"You're {$age} yearts old";
echo"Your gpa {$gpa}";
if($age >= 18){
$eligible = true;
}
?>2. operators
- arithmetic operators
<?php
$z = $x + $y;
$z = $x - $y;
$z = $x / $y;
$z = $x % $y;
$z = $x * $y;
$z = $x ** $y;
?>- increment / decrement
$x++;
$x--;