Hi, I'm not very well in php languange and, I've been scratching my head for days over these problems:
question1:
$a = array (1, 2, 3, 17);
foreach ($a as $v) {
print "Current value of \$a: $v.\n";
}
Can I know why I shall put a backslash\ in front of $a?
question2
$i = 0;
while (++$i) {
switch ($i) {
case 2:
echo "At 5<br>\n";
break 1; / Exit only the switch. /
case 3:
echo "At 10; quitting<br>\n";
break 2; / Exit the switch and the while. /
default:
break;
}
}
The output would be: At 5
At 10; quitting
Is it a 'MUST' to put ++$i as the while loop expression?Why?What does this statement stand for? Secondly I wonder why the code still works even when I replace $i = 0 with $i = 1.(first line)
Thank you very much.