note 23253 added to control-structures.do.while

From: Date: Fri, 12 Jul 2002 20:03:12 +0000
Subject: note 23253 added to control-structures.do.while
Groups: php.notes 
Request: Send a blank email to php-notes+get-33004@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 -- http://www.php.net/manual/en/control-structures.do.while.php http://master.php.net/manage/user-notes.php?action=edit+23253 http://master.php.net/manage/user-notes.php?action=delete+23253 http://master.php.net/manage/user-notes.php?action=reject+23253

« previous php.notes (#33004) next »