WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Mobile Dev World
Limits the maximum execution time

set_time_limit

(PHP 4, PHP 5)

set_time_limitLimits the maximum execution time

Description

void set_time_limit ( int $seconds )

Set the number of seconds a script is allowed to run. If this is reached, the script returns a fatal error. The default limit is 30 seconds or, if it exists, the max_execution_time value defined in the php.ini.

When called, set_time_limit() restarts the timeout counter from zero. In other words, if the timeout is the default 30 seconds, and 25 seconds into script execution a call such as set_time_limit(20) is made, the script will run for a total of 45 seconds before timing out.

Parameters

seconds

The maximum execution time, in seconds. If set to zero, no time limit is imposed.

Return Values

No value is returned.

Notes

Warning

This function has no effect when PHP is running in safe mode. There is no workaround other than turning off safe mode or changing the time limit in the php.ini.

Note: The set_time_limit() function and the configuration directive max_execution_time only affect the execution time of the script itself. Any time spent on activity that happens outside the execution of the script such as system calls using system(), stream operations, database queries, etc. is not included when determining the maximum time that the script has been running. This is not true on Windows where the measured time is real.


a set of php scripts and html pages to access a consult database. consultDB currently supports: -mileage log -time tracking -extensible reports -easy editing
Categories : Databases, PHP
SQL_CALC_FOUND_ROWS - How to know the number of rows a query would have returned if there was no LIMIT set on the query using php5 and mysqli.Usfull with Pagination (Paging).
Categories : PHP, Databases, MySQL
Warning: Unknown(): A session is active. You cannot change the session module's ini settings at this time. in Unknown on line 0
Categories : PHP, Sessions, Databases, MySQL



A simple function to get the UTC offset of your location. Handy for sites that don't have more recent versions of PHP with date/time functions with options that return the offset.
Categories : PHP, Date Time
Complex paging with no resultset limit
Categories : PHP, MySQL, Databases, Output Control, HTML and PHP
Changing the default 30 seconds time limit of PHP scripts
Categories : PHP, PHP Options and Info
'Random effect text' - This randomly select characters from a text string and changes the characters color for a short set time period.
Categories : Java Script
Quick code to show how to limit strings to a certain word count
Categories : PHP, Strings
Retrieve text from table and email to your e- address in pipe delimited format.
Categories : PHP, MySQL
Time Format Conversion
Categories : PHP, Date Time
A set of functions to check the validity of a credit card number.
Categories : Ecommerce, Credit Cards, PHP
Load delimited textfile into MySql table.
Categories : PHP, Databases, MySQL
PHP5 and __get and __set
Categories : PHP, PHP Classes
Calculating Time in Php ( Using + or - )
Categories : PHP, Date Time