set_time_limit()


void set_time_limit ( int $seconds )

Description

set_time_limit() limits the maximum execution time of the PHP script.
The default limit time of the HTTP session is 4 seconds.
And the default limit time of the non-PHP script is infinite(0).

※ available F/W version : all

Parameters

Return values

Returns none, PHP error on failure

Example

<?php   
set_time_limit(5);  // limits PHP execution time to 5 seconds
while(1)
{
    sleep(1);
    echo ".";
}
// After testing this code, you should run "set_time_limit(0);" to avoid terminating another codes.
?>

See also

None

Remarks

This function is identical to the PHP Groups’s PHP. Do not use it with infinite loop code.