Using if to test for multiple values : If statement « Statement « PHP
- PHP
- Statement
- If statement
Using if to test for multiple values
<?
$action = "ADD";
if ($action == "ADD") {
echo "Perform actions for adding.";
}
elseif ($action == "MODIFY") {
echo "Perform actions for modifying.";
}
elseif ($action == "DELETE") {
echo "Perform actions for deleting.";
}
?>
Related examples in the same category