SplFileInfo::isLink

(PHP 5 >= 5.1.2, PHP 7)
Tells if the file is a link
public bool SplFileInfo::isLink ( void )

Use this method to check if the file referenced by the SplFileInfo object is a link.

Returns:

Returns TRUE if the file is a link, FALSE otherwise.

Examples:
SplFileInfo::isLink() example
<?php
$info = new SplFileInfo('/path/to/symlink');
if ($info->isLink()) {
    echo 'The real path is '.$info->getRealPath();
}
?>

See also:

SplFileInfo::getRealPath() -

doc_php
2016-02-24 16:20:16
Comments
Leave a Comment

Please login to continue.