note 71447 deleted from function.file-exists by nlopess
| From: | nlopess@php.net | Date: | Sat, 13 Jan 2007 22:31:33 +0000 |
| Subject: | note 71447 deleted from function.file-exists by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-121617@lists.php.net to get a copy of this message | ||
Note Submitter:
----
Don't use this function in loops as it's pretty slow:
leibwaechter at web dot de
<?php
function url_exists($url)
{
$handle = @fopen($url, "r");
if ($handle === false)
return false;
fclose($handle);
return true;
}
?>
Best in situations where it is a one off. Better still try to do without it. Checking lots of
addresses with this involves lots of dns lookups etc.