Posts: 2,536
Location: Western Maryland
|
You can only have one default for a switch statement and it does not take a value. The default clause is meant as a catch all for all other values not covered by other cases. See simple example below.
Your code has multiple defaults and pass values to it; that is your problem.
PHP Code:
<?php
$n = 2;
$value = "";
switch( $n )
{
case 1: $value = "one";
break;
case 2: $value = "two";
break;
default: $value = "A really big number.";
break;
}
?>
__________________
—Kyrnt
|