symlink() function in PHP


The symlink() function creates a symbolic link. It returns TRUE on success or FALSE on failure.

Syntax

symlink( target, link)

Parameters

  • target − Target of the link to be created.

  • link − Name of the link.

Return

The symlink() function returns TRUE on success or FALSE on failure.

Example

<?php
$target = new.php';
$mylink = new.html';
$res = symlink($target, $mylink);
if ($result) {
   echo ("Symlink created!");
} else {
   echo ("Symlink can’t be created!");
}
?>

Output

Symlink created!

Updated on: 24-Jun-2020

116 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements