The is_link()
function in PHP checks whether the given filename is a
is_link(string $name): bool
name
: This specifies the path to the file we want to check.
is_link()
returns true
if the provided filename exists and is also a symbolic link. Otherwise, it returns false
.
The following code shows how to use the is_link()
function.
<?php$name = "documents"; // a file path which is checked whether it is a symbolic link or not.if(is_link(name)){echo ("name is a link"); // here if the argument is a valid symbolic link}else{echo ("name is not a link"); // here if the argument is not a valid symbolic link}?>
This function produces cache output. We have to clear the cache by using the
clearstatcache()
function.
Free Resources