SplFileInfo::isLink()
(PHP 5 >= 5.1.2, PHP 7)
Tells if the file is a link
说明
public SplFileInfo::isLink(void): bool
Use this method to check if the file referenced by the SplFileInfo object is a link.
参数
此函数没有参数。
返回值
Returns TRUE if the file is a link,FALSE otherwise.
范例
SplFileInfo::isLink() example
<?php
$info = new SplFileInfo('/path/to/symlink');
if ($info->isLink()) {
echo 'The real path is '.$info->getRealPath();
}
?>
参见
- SplFileInfo::getRealPath() Gets absolute path to file
