Learning PHP and MySQL
Example 04-09 Using if to test for multiple values
<?php
if ($action == "ADD") {
echo "Perform actions for adding.";
echo "As many statements as you like can be in each block.";
}
elseif ($action == "MODIFY") {
echo "Perform actions for modifying.";
}
elseif ($action == "DELETE") {
echo "Perform actions for deleting.";
}
?>
Posted by on 08/03 at 08:12 AM
Next entry: Example 04-11 What happens when there are no break keywords
Previous entry: Example 04-08 Using the ? operator to create a message