English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Basic PHP Tutorial

Advanced PHP Tutorial

PHP & MySQL

PHP Reference Manual

PHP is_link() Function Usage and Example

PHP Filesystem Reference Manual

The is_link() function can check if the specified file is a symbolic link. It returns TRUE if the file exists and is a symbolic link, otherwise it returns FALSE.

Syntax

bool is_link ( string $filename )

This function can return true if the filename exists and is a symbolic link, otherwise it returns false.

Online Example

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

Output Result

/PhpProject/images is not a link

PHP Filesystem Reference Manual