goto statement in php

This is how we can use goto statement php:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>

</head>

<body>
<?php
goto a;
echo 'Hello';

a:
echo 'World';
?>
</body>
</html>

 

Add a Comment

Your email address will not be published. Required fields are marked *