Introduction
We are describing how to use a Goto statement in PHP. Goto statements branch unconditionally from one place to another place in the program. The Goto statement is only available in the latest version of PHP 5.3 or higher PHP versions. We can say that a Goto statement jumps to another section of the program. The Goto Statement requires a label to identify the place where the branch is to be made. A label is any valid variable name and must be followed by a colon(:). A label is immediately placed before the statement where the control is to be transferred. A Goto is a very controversial programming statement.

Syntax
|
<?php gotolabel; ?> |
Note
The program can be used anywhere in the program before or after the Goto statements. The program runs and when a Goto statement is encountered the flow of program will be transferred to the statement with the specified label. This will occur unconditionally.
Example1
<?php
echo "Lets start with Go To"."<br>";
goto read;


Sam HobbsPosted Jan 25, 2013, 4:08 PM
The reason why gotos are controversial is that it is more likely that programs written using them will have "spaghetti code"; code that is as difficult to untangle as a bowl of spaghetti. It should also be noted that if a program uses gotos then other deveolpers might be critical and some developers will be emotional, not logical, in their criticsm.