php set_time_limit()设置页面执行时间
set_time_limit函数可以临时定义你当前页面的执行时间,set_time_limit(0)时页面就永远有效直到程序执行完毕了,下面我来介绍set_time_limit用法.
语法 : void set_time_limit (int seconds)
注意 : 当PHP是执行在安全模式时,set_time_limit( )将不会有结果,除非是关闭安全模式或是修改结构档案中(在PHP3中叫做php3.ini,在PHP4则叫做php.ini)的时间限制.
实例代码如下:
<?php set_time_limit(1000) ?>
当此函数被调用时, set_time_limit()会从零开始重新启动超时计数器.换句话说,如果超时默认是30秒,在脚本运行了了25秒时调用 set_time_limit(20),那么,脚本在超时之前可运行总时间为45秒.
实例代码如下:
<?php require_once('db.php'); $stmt = $db->query($sql); while ($row = $stmt->fetchRow()) { set_time_limit(0); // your code here } ?>
相关文章:
php页面最大执行时间 set_time_limit函数不起作用

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)
