SplFileInfo::isLink

(PHP 5 >= 5.1.2, PHP 7, PHP 8)

SplFileInfo::isLinkTells if the file is a link

說明

public SplFileInfo::isLink(): bool

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

參數(shù)

此函數(shù)沒有參數(shù)。

返回值

Returns true if the file is a link, false otherwise.

范例

示例 #1 SplFileInfo::isLink() example

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

參見