首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

link

(PHP 4, PHP 5, PHP 7)

链接 - 创建一个硬链接

描述

代码语言:javascript
复制
bool link ( string $target , string $link )

link()创建一个硬链接。

参数

target

链接的目标。

link

链接名称。

返回值

TRUE成功或FALSE失败时返回。

更新日志

描述

5.3.0

此功能现在可在Windows平台(Vista,Server 2008或更高版本)上使用。

例子

Example #1 Creating a simple hard link

代码语言:javascript
复制
<?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);
?>

注意

注意:此功能在远程文件上不起作用,因为要检查的文件必须可通过服务器的文件系统访问。

注意:仅适用于Windows:此功能要求PHP以提升模式运行或禁用UAC。

扫码关注腾讯云开发者

领取腾讯云代金券