SplFileInfo::isLink
PHP function
Edit on GitHub ✎
(PHP 5 >= 5.1.2, PHP 7, PHP 8)
Tells if the file is a link
Description
SplFileInfo::isLink(): bool
Use this method to check if the file referenced by the SplFileInfo object is a link.
Parameters Parameters
Return Values
Returns true if the file is a link, false otherwise.
Examples
SplFileInfo::isLink() example
php
<?php
$info = new SplFileInfo('/path/to/symlink');
if ($info->isLink()) {
echo 'The real path is '.$info->getRealPath();
}
?>See Also
SplFileInfo::getRealPath