Here is the code, do you have any idea what's going wrong with it?
I can't link to a result page, because its my local test server, but check at the bottom for a dump of what it tells me.
Code: Select all
<?php
//URL ARRAY
$links = array ("www.hammerslane.com","www.phpbuilder.com","www.linkynoworkyaaaaaaaaaa.com");
function chkuri($link)
{
$churl = @fopen("http://".$link,'r');
if (!$churl) {
return false;
}else{
return true;
}
}
foreach($links AS $link)
{
if(!chkuri($link))
{
print"$link is down<br><br>";
}
else
{
print"$link is up<br><br>";
}
}
?>Code: Select all
www.hammerslane.com is down
їurl]www.phpbuilder.comї/url] is down
їurl]www.linkynoworkyaaaaaaaaaa.comї/url] is downanyone have an idea?
many thanks