Home  >  Article  >  Backend Development  >  php 怎么返回当前运行状态

php 怎么返回当前运行状态

WBOY
WBOYOriginal
2016-06-13 12:53:361009browse

php 如何返回当前运行状态
    在UI的一次请求中,PHP响应可能要几分钟之久。我想PHP在响应的过程中,返回一些提示给UI,例如一分钟时返回“分析指标1”,两分钟时返回“分析指标2”。
    请教各位大虾要怎么做?


------解决方案--------------------
换成多次请求 类似下面的代码
<br />
if($_GET['p']=='1'){<br />
 echo '动作1已经处理完';<br />
}else if($_GET['p']=='2'){<br />
 echo '动作2已经处理完';<br />
}<br />

这样一次请求不会处理比较长的时间 很快就能看到结果
------解决方案--------------------
是的是要 要先让浏览器的缓存满
那你就发出足够充满缓存的数据不就行了?
并且发出的应该是 js 代码
Statement:
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
Previous article: 问基础有关问题 Next article: 如何改每行资料