How to close the browser and continue execution in php

藏色散人
Release: 2023-03-09 07:36:01
Original
2569 people have browsed it

php method to close the browser and continue execution: first open the corresponding PHP code file; then use the "set_time_limit(0)" method to allow the program to execute without limit.

How to close the browser and continue execution in php

The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer

PHP close the browser and continue execution

ignore_user_abort();//关掉浏览器,PHP脚本也可以继续执行.  
set_time_limit(0);// 通过set_time_limit(0)可以让程序无限制的执行下去  
$interval=60*30;// 每隔半小时运行  
do{  
    //这里是你要执行的代码      
    sleep($interval);// 等待5分钟  
}while(true);
Copy after login

[Recommended learning: PHP video tutorial]

The above is the detailed content of How to close the browser and continue execution in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template