exit in php

If you want to finish executing the entire PHP script, you can use exit. This approach is typically useful when you are performing error checking

if($totalqty == 0){
 echo "You did not order anything on the previous page!<br />";
 exit;
}

The call to exit stops PHP from executing the remainder of the script

Leave a Comment