Page 1 of 1

Break n

Posted: Sun Aug 08, 2004 12:41 pm
by anjanesh
The paramter for Break is a nice thing and wanted to use it. But Im not getting it to work.

Code: Select all

<?php
if (1==1)
{
if (2==3)
 echo "2=3";
else
 break 1;

echo "1==1";
}
?>
By the way the basic break which can be done in C also doesn't work in if {} blocks

Code: Select all

if (2==2)
{
break;
}
Any way to solve this ? Or wasnt this the original intention of using break in php ?
Thanks

Posted: Sun Aug 08, 2004 12:58 pm
by feyd
break doesn't work for anything outside loops... last I checked..