search for in the  
<is_linkis_uploaded_file>
Last updated: Thu, 19 May 2005

is_readable

(PHP 3, PHP 4, PHP 5)

is_readable -- Tells whether the filename is readable

Description

bool is_readable ( string filename )

Returns TRUE if the filename exists and is readable.

Keep in mind that PHP may be accessing the file as the user id that the web server runs as (often 'nobody'). Safe mode limitations are not taken into account.

Example 1. is_writable() example

<?php
$filename
= 'test.txt';
if (
is_readable($filename)) {
   echo
'The file is readable';
} else {
   echo
'The file is not readable';
}
?>

Note: The results of this function are cached. See clearstatcache() for more details.

Tip: As of PHP 5.0.0 this function can also be used with some URL wrappers. Refer to Appendix L for a listing of which wrappers support stat() family of functionality.

See also is_writable(), file_exists(), and fgets().



User Contributed Notes
is_readable
php dot 5 dot ce at spamgourmet dot com
12-Jan-2005 08:32
If you are using ACL, watch out for Bug #30931 (now open without any reaction for about 2 month, alltough an solution exists.)
takeda at takeda dot tk
06-Jun-2003 11:36
this function also can be used if you want check permissions for directory.

<is_linkis_uploaded_file>
 Last updated: Thu, 19 May 2005
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: The Server Pages
Last updated: Thu May 19 17:35:34 2005 CDT