The set_time_limit function can temporarily define the execution time of your current page. When set_time_limit(0), the page will be valid forever until the program execution is completed. Let me introduce the usage of set_time_limit.
Syntax: void set_time_limit (int seconds)
Note: When PHP is running in safe mode, set_time_limit() will have no results unless safe mode is turned off or the structure file is modified (called php3.ini in PHP3 and php.ini in PHP4 ) time limit.
Example
The code is as follows
|
Copy code
|
||||
When this function is called, set_time_limit() will restart the timeout counter from zero. In other words, if the default timeout is 30 seconds and set_time_limit(20) is called when the script has been running for 25 seconds, then the total time the script can run before timing out is 45 seconds.
Previous article:Detailed explanation of global variables in PHP_PHP tutorial
Next article:Array_merge program to merge two arrays in PHP_PHP tutorial
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
Latest Articles by Author
Latest Issues
Group MySQL results by ID for looping over
I have a table with flight data in mysql. I'm writing a php code that will group and displ...
From 2024-04-06 17:27:56
0
1
406
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
|