PHP is_link() Function
❮ PHP Filesystem ReferenceExample
Check whether the specified filename is a symbolic link:
<?php
$link = "images";
if(is_link($link)) {
echo ("$link is a link");
} else {
echo ("$link is not a link");
}
?>
The output of the code above could be:
images is not a link
Definition and Usage
The is_link() function checks whether the specified filename is a symbolic link.
Note: The result of this function is cached. Use clearstatcache() to clear the cache.
Syntax
is_link(file)
Parameter Values
Parameter | Description |
---|---|
file | Required. Specifies the path to the file to check |
Technical Details
Return Value: | TRUE if the file is a symbolic link, FALSE and an E_WARNING otherwise |
---|---|
PHP Version: | 4.0+ |
❮ PHP Filesystem Reference