Learning PHP and MySQL
Example 04-10 Using switch to test for multiple values
<?php
switch ($action) {
case "ADD":
echo "Perform actions for adding.";
echo "As many statements as you like can be in each block.";
break;
case "MODIFY":
echo "Perform actions for modifying.";
break;
case "DELETE":
echo "Perform actions for deleting.";
break;
}
?>
Posted by on 08/03 at 08:13 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