PHP脚本可以启动另一个PHP脚本并退出吗?
发布时间:2020-12-13 14:09:19 所属栏目:PHP教程 来源:网络整理
导读:PHP脚本如何启动另一个 PHP脚本,然后退出,让另一个脚本运行? 另外,第二个脚本是否有任何方法在PHP脚本到达特定行时通知它? 这是怎么做的.您告诉浏览器读取输出的前N个字符,然后关闭连接,同时脚本一直运行直到完成. ?phpob_end_clean();header("Connection:
PHP脚本如何启动另一个
PHP脚本,然后退出,让另一个脚本运行?
另外,第二个脚本是否有任何方法在PHP脚本到达特定行时通知它?
这是怎么做的.您告诉浏览器读取输出的前N个字符,然后关闭连接,同时脚本一直运行直到完成.
<?php ob_end_clean(); header("Connection: close"); ignore_user_abort(); // optional ob_start(); echo ('Text the user will see'); $size = ob_get_length(); header("Content-Length: $size"); ob_end_flush(); // Will not work flush(); // Unless both are called ! // At this point,the browser has closed connection to the web server // Do processing here include('other_script.php'); echo('Text user will never see'); ?> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |