Conditional Statements in PHP
Conditional statements are used to perform different actions based on different conditions. PHP supports different types of conditional statements such as if-else, switch, and ternary operator.
Example:
bash
$age = 25;
if($age < 18){
echo "You are not eligible to vote";
}
else{
echo "You are eligible to vote";
}
No comments:
Post a Comment