Control Structures
PHP Manual

goto

The goto operator can be used to jump to another section in the program. The target point is specified by a label followed by a colon, and the instruction is given as goto followed by the desired target label.

Example #1 goto example

<?php
goto a;
echo 
'Foo';
 
a:
echo 
'Bar';
?>

The above example will output:

Bar

Note: The goto operator is available as of PHP 5.3.

Warning

It is not allowed to jump into a loop or switch statement. A fatal error is issued in such cases.


Control Structures
PHP Manual