• ? SplFileInfo::isFile
  • SplFileInfo::isReadable ?
  • 锟斤拷锟斤拷学院 www.cainiaoplay.com
  • PHP Manual
  • SplFileInfo
  • Tells if the file is a link

SplFileInfo::isLink

(PHP 5 >= 5.1.2, PHP 7)

SplFileInfo::isLink — 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.

锟斤拷锟斤拷

Example #1 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