<?php
$i = 1;
echo "loop started at " . $i . "<br />";
while($i++)
{
switch($i)
{
case 2;
echo "break 1 used inside switch when i = " . $i . "<br />";
break;
case 4:
echo "break 2 used inside switch when i = " . $i . ". This will end the while loop process, so 'i = $i, inside while loop' will not be printed<br />";
break 2;
}
echo"i = $i, inside while loop <br />";
}
?>