note 71537 deleted from function.file-exists by colder
| From: | colder@php.net | Date: | Mon, 04 Dec 2006 23:32:46 +0000 |
| Subject: | note 71537 deleted from function.file-exists by colder | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-120284@lists.php.net to get a copy of this message | ||
Note Submitter: vivango at cs dot vu dot nl
Reason: useless
----
"if ($handle === false)"
should be
"if ($handle == false)"
---
User Contributed Notes
file_exists
29-Nov-2006 04:35
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