is_link

bool is_link(string filename) 

Checks whether a file is a link.

Returns:

TRUE if a link; FALSE otherwise

Description:

Checks whether the specified file is a link as opposed to a regular file or a directory.

Note:

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

Warning:

3.0.1: Doesn’t return meaningful results on Linux 2.0.34.

Example:

Test for a link
$link = "testlink"; 

if(is_link($link)) 
{
    echo ("$link is a link."); 
} 
else 
{
    echo ("$link could be a file or directory."); 
} 

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.