array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'pt_BR', ), 'this' => array ( 0 => 'function.symlink.php', 1 => 'symlink', ), 'up' => array ( 0 => 'ref.filesystem.php', 1 => 'Funções do sistema de arquivos', ), 'prev' => array ( 0 => 'function.stat.php', 1 => 'stat', ), 'next' => array ( 0 => 'function.tempnam.php', 1 => 'tempnam', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'pt_BR', '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 — Cria uma ligação simbólica
symlink() cria uma ligação simbólica ao alvo existente
em target
com o nome especificado em
link
.
target
Alvo da ligação.
link
O nome da ligação.
A função falha e emite um E_WARNING
,
se link
já existir.
No Windows, a função também falha e emite um E_WARNING
se target
não existir.
Exemplo #1 Cria uma ligação simbólica
<?php
$target = 'uploads.php';
$link = 'uploads';
symlink($target, $link);
echo readlink($link);
?>