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
-
chris
- Site Admin
- Posts: 216
- Joined: Mon Jul 21, 2008 9:52 am
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"); //octalCode: Select all
die("There was a fatal error");