Hi,
I would like to know what the best way is to end a script,
in the middle?
Lets say after a if-statement .
thanks,
end php script
Re: end php script
You can use exit
You can also use die(), wich is the same but mostly used with a error code
Code: Select all
//exit program normally
exit;
exit();
exit(0); //this program ran successfully/without errors"
//exit with an error code
exit(1);
exit("error text"); //octal
Code: Select all
die("There was a fatal error");