English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Online Tools

Basic PHP Tutorial

Advanced PHP Tutorial

PHP & MySQL

Object Function

PHP Filesystem Reference Manual

PHP link() Function Usage and Example

The link() function can create a hard link to an existing target with a specified name link and 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 file system. It does not work on the Windows platform.

Example
   <?php/$link = "/$target = " 
   sample.txt"/$link = "/PhpProject
   link($target, "linktest.txt");
   echo "Link successful";
?>

Output result

Link successful

PHP Filesystem Reference Manual