Checking multiple conditions : If statement « Statement « PHP
- PHP
- Statement
- If statement
Checking multiple conditions
<?
if ($username == "Admin"){
echo ('Welcome to the admin page.');
}
elseif ($username == "Guest"){
echo ('Please take a look around.');
}
else {
echo ("Welcome back, $username.");
}
?>
Related examples in the same category