0

我正在运行一个脚本,每分钟执行一个脚本,但由于某种原因它没有出现在我的浏览器上,无法判断它是否正在运行。

<?php


set_time_limit(0);
ob_implicit_flush(true);
$interval=1; //minutes
echo str_repeat(" ", 1024);
while(true) {
    $now=time();
    echo $now."<BR>";
    sleep($interval * 60);
    flush();
}
ob_end_flush();
?>
4

1 回答 1

0

Because php doesn't work like this. PHP is serversided, it will generate everything and send the HTML to the client. You have to use javascript for this

于 2013-03-08T10:45:22.030 回答