I like to do a "background timer" but I don't know how. The main things: I have if, and if I go in I like to set the time, and start a timer ($ido = $split[0]*60*60 + $split[1]*60 + $split[2]; sleep($ido);)
, and after this timer end, I like to run a function ($jatek->epuletkesz();)
but, after this if, I have another things, and if i start sleep the page loading is stop because wait for the sleep end. But I like, the sleep go in "background" and don't stop the page things, only the one function run after sleep end.
(Sorry for bad English, I hope u can understand my problem.)
Here is the code:
if(empty($üzi)) {
echo "<script type='text/javascript'>alert('Sikeres fejlesztés!');</script>";
$nyers = $jatek->kovnyers($epulet);
$split = explode(":", $nyers['epetesiido']);
$ido = $split[0]*60*60 + $split[1]*60 + $split[2];
sleep($ido);
$jatek->epuletkesz();
//header( 'Location: ../views/jatek.php' );
}