I have a PHP script that will run for a long time. I have set the execution time limit to 5 minutes by using set_time_limit() function. I would like to ask whether I can set the script to call a function when timeout limit is reached? like the page unload script in JavaScript or viewDidUnload func开发者_C百科tion in NSViewController, in iPhone SDK ?
You can use register_shutdown_function() to register a callback, that is called, when the execution finishes. You should also have a look at connection handling.
You can do it by using register_shutdown_function() But this isn't good practice, remeber that you will catch also fatal error, parse errors etc.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论