Menu Home

ignore_user_abort

osbo.com | PHP | Functions | ignore_user_abort

Set whether a client disconnect should abort script execution

Syntax

ignore_user_abort ( [ bool $value ] ) : int

Parameters

value

If set, this function will set the ignore_user_abort ini setting to the given value. If not, this function will only return the previous setting without changing it.

Return

Returns the previous setting, as an integer.

Examples

<?

// ignore user aborts
ignore_user_abort(true);

// allow script to run forever
set_time_limit(0);

// run loop
while(true)
{
    // break if connection fails
    if(connection_status() != CONNECTION_NORMAL)
    {
        break;
    }

    // sleep 10 seconds
    sleep(10);
}

//the break was triggered so we can perform other tasks without being dependent on the browser...

?>

			
			
		

PHP