You can skip over chunks of code in PHP using goto
. This is not a function so it does not require parenthesis, and it only works if you have php 5.3 or later. In our example below we will echo a line, but it will not output anything if we execute the PHP, because it is in the section of code we are skipping.
echo 'This will be skipped';
echo 'Why hello!';
If you run this code you will only see "Why hello!" and not the other line we echo because it is in the section of code that we skipped between goto and the mark we were searching for.