How to use symlink in PHP

In this article I am going to explain about symlink function in PHP.
  • 1250

PHP symlink() Function

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

Syntax of symlink function

symlink(target, link)

Parameters in symlink function

It have two parameter:

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

Example of filesystem symlink function will only run on Window Vista/Window Server 2008 or grater:

<html>

<body>

<?php

$target = 'die.php';

$link = 'die';

symlink($target, $link);

echo readlink($link);

?>

</body>

</html>


You may also want to read these related articles :
here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.