link

(PHP 4, PHP 5, PHP 7)
Create a hard link
bool link ( string $target, string $link )

link() creates a hard link.

Parameters:
target

Target of the link.

link

The link name.

Returns:

Returns TRUE on success or FALSE on failure.

Changelog:
5.3.0

This function is now available on Windows platforms (Vista, Server 2008 or greater).

Notes:
This function will not work on remote files as the file to be examined must be accessible via the server's filesystem.
For Windows only: This function requires PHP to run in an elevated mode or with the UAC disabled.
Examples:
Creating a simple hard link
1
2
3
4
5
6
<?php
$target 'source.ext'// This is the file that already exists
$link 'newfile.ext'// This the filename that you want to link it to
 
link($target$link);
?>
See also:

symlink() -

readlink() -

linkinfo() -

doc_php
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.