PHP is_link() Function

Definition and Usage

The is_link() function determines whether the specified filename is a symbolic link.

Syntax

is_link(file)
Parameter Description
file Required. Specifies the file to be checked.

Description

If the file exists and is a symbolic link, it will return true.

Tips and Comments

Note:The result of this function will be cached. Please use clearstatcache() to clear the cache.

Example

<?php
$link = "images";
if(is_link($link))
  {
  echo("$link is a link");
  }
else
  {
  echo("$link is not a link");
  }
?>

Output:

images is not a link