basically, switch just replaces hordes of 'if' and 'esleif' statements
in the following case, the action of the form is altered depending on the value of $_GET['Radio']
<?
echo "<form action='";
switch ($_GET['Radio'])
{
case "0":
echo "basicliquid.php";
break;
case "1":
echo "basicpowder.php";
break;
}
echo "' method='get'>\n";
?>
if you were using 'if' statements, it would look like this:
<?
echo "<form action='";
if ($_GET['Radio'] == "0")
{
echo "basicliquid.php";
}
elseif ($_GET['Radio'] == "1")
{
echo "basicpowder.php";
}
echo "' method='get'>\n";
?>
Where switch() comes in handy is when you have dozens of possible options - it just makes for cleaner, easier to read, easily maintainable code