The exit command is used to stop the php program. It is not a frequently used command, but depending on the result of a function, the program may be stopped and used in such cases.
example:
<?php echo "Start \n"; echo "Hello World! \n"; exit; echo 'Finish'; ?>
output:
Start Hello World!
No command will run after the exit command.
Tagged In:
Php