note 23252 deleted from control-structures.do.while by dams
| From: | dams@php.net | Date: | Sat, 27 Jul 2002 23:21:56 +0000 |
| Subject: | note 23252 deleted from control-structures.do.while by dams | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-33736@lists.php.net to get a copy of this message | ||
> temp_guy wrote amongst other things...
> But this example could just as easily
> be accomplished with if-else...
yes but...
do{
if ($a==10){
if($b ==30){
if($c='OK'){ print 'b=30'; }else break;
}else if ($b==40){
// $c not important here if $b==40
print 'b=40';
}
print 'all OK';
} while(0)
supose: a=10, b=30 but c=not_ok
then it would print all ok if you
didn't use break. You could check again
for all cases befor print 'all ok' but
that would look like this:
// still ok?
if(($a==10)&&(($b==40)||(($b==30)&&($c=='OK')))) print 'all ok';
now add $d and your up for a headache
tr