link
(PHP 4, PHP 5, PHP 7, PHP 8)
link — 建立一個硬連線
說明
   link(string 
  $target, string $link): boollink() 建立一個硬連線。
參數
- 
target
- 
      要鏈接的目標。 
- 
link
- 
      鏈接的名稱。 
返回值
   成功時返回 true, 或者在失敗時返回 false。
  
註釋
注意: Windows下:該功能需要以 elevated 模式執行,或者關閉 UAC。
更新日誌
| 版本 | 說明 | 
|---|---|
| 5.3.0 | 該功能在 Windows 平臺下開始有效(Vista、 Server 2008 或更高版本)。 | 
範例
示例 #1 Creating a simple hard link
<?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);
?>
註釋
注意: 此函式不能作用於遠端檔案,被檢查的檔案必須是可通過伺服器的檔案系統訪問的。