Should there be a exit_php tutorial after PHP header?

Source: Internet
Author: User
PHP header after the need to write exit to terminate the program, has not been too concerned about, today encountered a bug, only to find that this is still a problem, deliberately wrote a piece of code test, the code is as follows:

 

The result proves that the PHP file runs if it encounters a header ("Location: a page URL"), and the statement jumps directly to another page, but the jump here does not affect the continuation of the current PHP file. That is to say, after the PHP header jump, the current page of the script will continue to execute. If you need to terminate the script, you need to add exit () or Die ().

Articles you may be interested in

    • PHP get_headers to determine if the URL is valid
    • function and usage of PHP get_headers functions
    • PHP with header () to achieve file download, download the file hint is broken can not open the solution
    • PHP Simulation get_headers function
    • PHP header 404 Jump error page of the wording
    • Summary of usage of PHP header
    • Usage and differences in PHP that jump out of multiple loops using Break,continue,goto,return,exit
    • PHP finds whether a value exists in the array (In_array (), Array_search (), array_key_exists ())

http://www.bkjia.com/PHPjc/764074.html www.bkjia.com true http://www.bkjia.com/PHPjc/764074.html techarticle PHP Header after the need to write exit to terminate the program, has not been too concerned about, today encountered a bug, only to find this is still a problem, deliberately wrote a piece of code test, code such as ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.