sleep 做掛在服務器定時操作功能
<?php
//關閉瀏覽器後,程序能繼續在後臺跑,這種情況下需要用到ignore_user_abort()函數
ignore_user_abort(true);
set_time_limit(0);
file_put_contents("heh.php","等20秒後,查看界面,還會有信息顯示");
sleep(20);
file_put_contents("heh.php","***********************20秒過後了!!!");
//關閉瀏覽器後,程序能繼續在後臺跑,這種情況下需要用到ignore_user_abort()函數
ignore_user_abort(true);
set_time_limit(0);
file_put_contents("heh.php","等20秒後,查看界面,還會有信息顯示");
sleep(20);
file_put_contents("heh.php","***********************20秒過後了!!!");
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章