• PHP Video Tutorials

PHP - Function link()



The link() function can create a hard link from an existing target with a specified name link, and this function can return true on success, or false on failure

Syntax

bool link ( string $target , string $link )

This function is not an HTML link, but a link in the filesystem. This function doesn't work on the Windows platform.

Example

<?php
   $target = "/PhpProject/sample.txt"; 
   $link = "/PhpProject/linktest.txt";

   link($target, $link);
   echo "linked successfully";
?>

Output

linked successfully
php_function_reference.htm
Advertisements