How to stop script execution in php

Guanhui
Release: 2023-02-28 21:24:01
Original
3263 people have browsed it

How to stop script execution in php

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!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!