• « SplFileInfo::isFile
  • SplFileInfo::isReadable »
  • PHP 5 Manual
  • SplFileInfo
  • Tells if the file is a link
Edit Report a Bug GitHub logo

SplFileInfo::isLink

(PHP 5 >= 5.1.2, PHP 7)

SplFileInfo::isLink — Tells if the file is a link

Description

public SplFileInfo::isLink ( void ) : bool

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() - Gets absolute path to file
  • Other versions of this page
    • PHP 4
    • PHP 5
    • PHP 7 (php.net)
    • PHP 8 (php.net)
Legacy manuals maintained by Home
  • Get help migrating a legacy app
  • Extend PHP support for EOL versions