In this article, you will learn how to create a target symbolic link in PHP. The symlink() function in PHP creates a symbolic link from the existing target with the specified name link.
what is the syntax of the SYMLINK function in php?
symlink(target, link)
Parameter | Description |
---|---|
target | Required. Specifies the target of the link |
link | Required. Specifies the link name |
examples of the SYMLINK function
Example 1. In this example, we create a symbolic link.
<?php
$target = "downloads.php";
$link = "downloads";
symlink($target, $link);
echo readlink($link);
?>