1)  set_time_limit();

function to limit the maximum execution time. we can give values starting from zero.the default value is 30 seconds or as per we set on the php.ini file settings. If we given 60 as the time limits the execution will stop when the time reach and return a fatal error.

If we doesn't want to stop the script execution, at any time limit, we can set the function as given below.


2)  register_shutdown_function('functionname');

The function is used to register a function, while shutdown, like browser closing. We can register multiple shutdown functions. but when we use a exit on any function the functions resisted after that will not execute.

a sample register shutdown function

function browserClosed()
   //we can specify the logout actions on browser closing      
   echo "logout";


3)  ignore_user_abort(bool);

Used to set whether the script should abort, when the client disconnects. if it sets to false, it will abort the script, if its true, it will will not abort the script when the client disconnects.

We can use this function in a situation, when we want to close our browser before the execution completes.

Hope these tips are helpful to you all. Please comment about the posting, I always welcomes your feedback

Enjoy PHPing....


Post a Comment

Please put your comments here. your questions, your suggestions, also what went wrong with me.