How To Use setInterval in PHP?
<p>I want to ask that how can i use php function again and again after some time automatically just like setInterval in Javascript. We set the time and it is on its job until the script is aborted or closed.</p>

<p><strong>INDEX.PHP</strong></p>

<pre><code>&lt;?
$Wall = new Wall_Updates();
$updatesarray=$Wall-&gt;Updates();
foreach($updatesarray as $data)
{
    $likes=$data['likes'];
    ?&gt;
    &lt;div id="likes"&gt;&lt;?php echo $likes; ?&gt;&lt;/div&gt;
    &lt;?
}
?&gt;
</code></pre>

<p>And Wall_Updates() Function is defined here in <strong>FUNCTION.PHP</strong></p>

<pre><code>&lt;?php

class Wall_Updates {    
    public function Updates() {
        $myname=$_COOKIE['usename'];
        $query=mysql_query("SELECT * FROM posts WHERE name='$myname'");
        while($row=mysql_fetch_array($query))
            $data[]=$row;
        return $data;
    }
}
?&gt;
</code></pre>

<p>I want this Wall_Updates() function to fetch data from mysql again and again.So, It will be Updated.</p>
