note 75845 deleted from control-structures.switch by sp
| From: | sp@php.net | Date: | Thu, 22 May 2008 09:56:45 +0000 |
| Subject: | note 75845 deleted from control-structures.switch by sp | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-139602@lists.php.net to get a copy of this message | ||
Note Submitter: zzo38
----
There is no GOTO command in PHP, but you can do something similar like this:
<?php
function testfunction($x) {$label='';while(1){switch($label){
case '':
if($x==0) continue ($label='fail')*0+1;
case 'ok':
echo "ok\n";
case 'fail':
echo "fail\n";
return;
}}}
?>