Curriculum
Course: PHP Basic
Login

Curriculum

PHP Basic

PHP Install

0/1

PHP Casting

0/1

PHP Constants

0/1

PHP Magic Constants

0/1

PHP Operators

0/1

PHP Reference

0/276
Text lesson

symlink()

Example

Generate 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 with the specified name that points to the existing target.

 

Note: This refers to a filesystem link, not an HTML link.

Syntax

symlink(targetlink)

Parameter Values

 

Parameter

Description

target

Required. Specifies the target that the link points to.

link

Required. Specifies the name of the link.

Technical Details

Return Value:

Returns TRUE on success, FALSE on failure.

PHP Version:

4.0+

PHP Changelog:

Starting with PHP 5.3, available on Windows platforms.