How to stop script execution in php
To stop script execution in php, you can use "exit" and "die" Function, the essence of these two functions is the same. They stop the script from running. As long as the PHP script executes this function, it will stop executing the script. The difference between the two functions is that "exit" stops but does not release the memory, and "die" Stop and release memory.
Example
exit
Copy after login
Output result: I am exiting before stopping!
die
Copy after login
Output result: I am die before stopping!
The above is the detailed content of How to stop script execution in php. For more information, please follow other related articles on the PHP Chinese website!