利用 ob_end_clean ob_star usleep 实例定时器
<?php ignore_user_abort(true); set_time_limit(0); function test(){ echo "不要迷恋哥,哥只是个定时器!"; echo date('h:i:s') . "<br>"; } function just_do_it(){ test(); usleep(2000000); } ob_end_clean(); ob_start(); while(1){ echo str_repeat(" ",1024); ob_flush(); flush(); just_do_it(); }
本文地址:http://www.phprm.com/code/1739f72d2c1384c0534715f11a618625.html
转载随意,但请附上文章地址:-)