PHP is_link()Functions


PHP Filesystem 参考手册Complete PHP Filesystem Reference Manual

Definition and Usage

The is_link() function checks whether the specified file is a link.

If the file is a link, the function returns TRUE.

Syntax

is_link(file)

Parameters Description
file Required. Specifies the file to check.


Tips and Notes

Note:The result of this function is cached. Use clearstatcache() to clear the cache.


Examples

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

The above code will output:

images is not a link


PHP Filesystem 参考手册Complete PHP Filesystem Reference Manual Other Extensions