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

is_link

(PHP 3, PHP 4, PHP 5)

is_link -- Tells whether the filename is a symbolic link

Description

bool is_link ( string filename )

Returns TRUE if the filename exists and is a symbolic link.

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_dir(), is_file(), and readlink().



User Contributed Notes
is_link
andudi at gmx dot ch
02-Jun-2002 12:44
On my SuSE 7.2 is_link does not work on directories, but to find out, if a dir is a link, I use now this:

$linkdir = $path.$linkdirname;
if (realpath($linkdir) != realpath($path)."/".$linkdirname):
//$linkdir is a symbolic linked dir!
...

and this works fine :-)

Andreas Dick
aris at riponce dot com
27-Mar-2001 04:27
If you test a symbolic (soft) link with is_file() it will return true. Either use filetype() which always returns the correct type OR make sure that you FIRST test with is_link() before you do with is_file() to get the correct type.

<is_fileis_readable>
 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