PHP symlink() Function

❮ PHP Filesystem Reference

Example

Create a symbolic link:

<?php
$target = "downloads.php";
$link = "downloads";
symlink($target, $link);
echo readlink($link);
?>


Definition and Usage

The symlink() function creates a symbolic link from the existing target with the specified name link.

Note: This is not an HTML link, but a link in the filesystem.


Syntax

symlink(target, link)

Parameter Values

Parameter Description
target Required. Specifies the target of the link
link Required. Specifies the link name


Technical Details

Return Value: TRUE on success, FALSE on failure
PHP Version: 4.0+
PHP Changelog: PHP 5.3: Available on Windows platforms

❮ PHP Filesystem Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.