linkinfo

int linkinfo(string path) 

Gets information about a link.

Returns:

Device ID on success; -1 on error

Description:

This function can be used to check whether a link exists. If the link exists, the function returns the st_dev field from the UNIX stat() function.

Example:

Test a link
$path = "/home/usr/mylink"; 

if(linkinfo($path) != -1) 
{
    echo ("Link exists."); 
} 
else 
{
    echo ("Link does not exist."); 
} 

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.