Use the link() function in PHP to create a hard link.
Syntax
link(target, link)
Parameters
target − The target of the link. Required.
link − The name of the link. Required.
Return
The link() function returns TRUE on success or FALSE on failure.
Example
<?php $file = 'new.php'; $newlink = 'mynew'; link($file, $newlink); ?>
Output
True