note 71447 added to function.file-exists
| From: | php-general at lists dot php dot net | Date: | Wed, 29 Nov 2006 15:35:32 +0000 |
| Subject: | note 71447 added to function.file-exists | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-120161@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 83.138.144.80
Probable Submitter: 82.71.67.46
----
Manual Page -- http://www.php.net/manual/en/function.file-exists.php
Edit -- https://master.php.net/note/edit/71447
Del: integrated -- https://master.php.net/note/delete/71447/integrated
Del: useless -- https://master.php.net/note/delete/71447/useless
Del: bad code -- https://master.php.net/note/delete/71447/bad+code
Del: spam -- https://master.php.net/note/delete/71447/spam
Del: non-english -- https://master.php.net/note/delete/71447/non-english
Del: in docs -- https://master.php.net/note/delete/71447/in+docs
Del: other reasons-- https://master.php.net/note/delete/71447
Reject -- https://master.php.net/note/reject/71447
Search -- https://master.php.net/manage/user-notes.php