calling php function every x minutes
<p>got this code:</p>

<pre><code>&lt;?php
function test ($url){
$starttime = microtime(true);
$valid = @fsockopen($url, 80, $errno, $errstr, 30);
$stoptime = microtime(true);
echo (round(($stoptime-$starttime)*1000)).' ms.';

if (!$valid) {
   echo "Status - Failure";
} else {
   echo "Status - Success";
}
}
    test('google.com');
?&gt;
</code></pre>

<p>i want to use something like this:</p>

<pre><code>&lt;script&gt;
setInterval(function(){&lt;?php  test('google.com'); ?&gt;},3000);
&lt;/script&gt;
</code></pre>

<p>How di i call php function 'test' with setInterval?</p>
