Status
Not open for further replies.

viruz99

Active Member
1,547
2010
96
0
Hey guys , is there any way to add a time limit to a script :

e.g : 30 minutes & if the script still hasn't completed , it stops it .

There this function but don't know how it really works :

set_time_limit ();





 
7 comments
PHP:
<?php
// Set time limit before your code.
set_time_limit(1800); 
// Your code below...
?>
Set the time limit to 1800s/30min seconds.
 
I'm guessing after the time limit is over , it will immediately stops the script how it is. Is there any way for it to process certain functions before that ?





 
Sort of an automated download script - when it stops the script due to the time limit , i need to make it run a function to delete the files .

Maybe something like this :

set_time =1 ; ( kind of starts a counter when the script starts )

If $set_time = (3600) // ( when the script reaches 3600 sec , it does the following )

{
function to delete file
Stop command
]





 
Last edited:
Status
Not open for further replies.
Back
Top