setinterval function in js in php code example
Example 1: setinterval php
setInterval(function(){
echo "hi!\n";
}, 1000);
Example 2: setinterval php
function setInterval($f, $milliseconds)
{
$seconds=(int)$milliseconds/1000;
while(true)
{
$f();
sleep($seconds);
}
}