array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'fr', ), 'this' => array ( 0 => 'function.symlink.php', 1 => 'symlink', ), 'up' => array ( 0 => 'ref.filesystem.php', 1 => 'Fonctions sur les systèmes de fichiers', ), 'prev' => array ( 0 => 'function.stat.php', 1 => 'stat', ), 'next' => array ( 0 => 'function.tempnam.php', 1 => 'tempnam', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'fr', 'path' => 'reference/filesystem/functions/symlink.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
symlink — Crée un lien symbolique
symlink() crée un lien symbolique pour l'objet
target
avec le nom de link
.
target
La cible du lien.
link
Le nom du lien.
La fonction échoue, et émet une E_WARNING
,
si link
existe déjà.
Sur Windows, cette fonction échoue également, et émet uneE_WARNING
,
si target
n'existe pas.
Exemple #1 Création d'un lien symbolique
<?php
$target = 'uploads.php';
$link = 'uploads';
symlink($target, $link);
echo readlink($link);
?>