link()function in PHP


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

karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know

Updated on: 24-Jun-2020

291 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements