Conditional structures: Difference between revisions

m
Added PHP (switch) part, cleared up a bit
m (woops, typo)
m (Added PHP (switch) part, cleared up a bit)
Line 100:
==[[PHP]]==
[[Category:PHP]]
 
if
 
'''Interpreter''': [[PHP]] 3.x & 4.x & 5.x
Line 126 ⟶ 128:
//do another thing
}
?>
 
switch
 
'''Interpreter''': [[PHP]] 3.x & 4.x & 5.x
 
<?php
switch ($i)
{
case "apple":
echo "i is apple";
break;
case "bar":
echo "i is bar";
break;
case "cake":
echo "i is cake";
break;
}
Line 133 ⟶ 160:
=See Also=
* [http://www.php.net/manual/en/language.control-structures.php php.net:Control Structures]
* [http://www.php.net/manual/en/control-structures.switch.php php.net:Control Structures: Switch]