古詩詞大全網 - 成語查詢 - php執行了header("Location: index.php");後面程序會繼續執行嗎?

php執行了header("Location: index.php");後面程序會繼續執行嗎?

php文件運行的時候,雖然在腳本裏有header("Location: index.php");頁面跳轉到另壹個腳本,但是這個腳本的進程要執行完,所以header("Location: index.php");後面的代碼壹定會執行,如果要終止腳本運行,可以加exit(); 或者die();腳本就不會繼續執行了。