如何通过服务器实现数据流的截取?


在PHP开发中,通过设置脚本的超时时间,来终止程序的运行,我现在希望服务器传输了一部分数据之后,自动切断,如何实现?

服务器 apache nginx

lectror 13 years, 1 month ago

不知道这个是否能满足你,你可以参考这个做你延伸:

   
  <?php
  
Set_Time_Limit(0);
ignore_user_abort(true);//注意这个作用, 设置与客户机断开是否会终止脚本的执行
echo "哥们,这个断了\n";
sleep(10);
touch("test.txt");
echo "end";
?>

三倍速草泥马 answered 13 years, 1 month ago

Your Answer