• PHP Manual
  • Function Reference
  • Other Basic Extensions
  • SPL
  • File Handling
  • SplFileInfo
  • SplFileInfo::__construct
  • SplFileInfo::getATime
  • SplFileInfo::getBasename
  • SplFileInfo::getCTime
  • SplFileInfo::getExtension
  • SplFileInfo::getFileInfo
  • SplFileInfo::getFilename
  • SplFileInfo::getGroup
  • SplFileInfo::getInode
  • SplFileInfo::getLinkTarget
  • SplFileInfo::getMTime
  • SplFileInfo::getOwner
  • SplFileInfo::getPath
  • SplFileInfo::getPathInfo
  • SplFileInfo::getPathname
  • SplFileInfo::getPerms
  • SplFileInfo::getRealPath
  • SplFileInfo::getSize
  • SplFileInfo::getType
  • SplFileInfo::isDir
  • SplFileInfo::isExecutable
  • SplFileInfo::isFile
  • SplFileInfo::isLink
  • SplFileInfo::isReadable
  • SplFileInfo::isWritable
  • SplFileInfo::openFile
  • SplFileInfo::setFileClass
  • SplFileInfo::setInfoClass
  • SplFileInfo::__toString
SplFileInfo::isFile
SplFileInfo::isReadable
SplFileInfo
PHP Manual

SplFileInfo::isLink

Tells if the file is a link

Description

public bool SplFileInfo::isLink ( void )

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

Parameters

This function has no parameters.

Return Values

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

Examples

Example #1 SplFileInfo::isLink example

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

See Also

  • SplFileInfo::getRealPath