In this article, you will learn how to check if the name of the file is a symbolic link or not. The is_link() function in PHP checks whether the specified filename is a symbolic link.
what is the syntax of the IS_LINK function in php?
is_link(file)
Parameter | Description |
---|---|
file | Required. Specifies the path to the file to check |
examples of the IS_LINK function
Example 1. In this example, we check whether the specified filename is a symbolic link.
<?php
$link = "images";
if(is_link($link)) {
echo ("$link is a link");
} else {
echo ("$link is not a link");
}
?>