note 40737 added to function.file-exists
| From: | tonio_lesec at yahoo dot fr | Date: | Fri, 12 Mar 2004 15:54:09 +0000 |
| Subject: | note 40737 added to function.file-exists | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-66740@lists.php.net to get a copy of this message | ||
> your logic is backwards on your example
did u just read his code ?
> $return = strpos($arr_headers[0], "404") !== false;
returns true when 404 is found on the return file headers, a "404 not found" ...
this is a common way to write a function, returning 0 when it's all right and an error code
otherwise. i guess the function name is fuzzy :
remote_file_exists (yes, no) won't be logical
check_file_access (0, errno) will
but the example was correct :
> if (remote_file_exists ($url)) /* if 404 is found on the web server response header */
> { print ($url . " file doesn't exists!"); } /* this url cannot be retrieved */
i hope i'll be understandable, im just a poor froggy :)
----
Manual Page -- http://www.php.net/manual/en/function.file-exists.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40737
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40737&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40737&report=yes
Search -- http://master.php.net/manage/user-notes.php