array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'es', ), 'this' => array ( 0 => 'function.symlink.php', 1 => 'symlink', ), 'up' => array ( 0 => 'ref.filesystem.php', 1 => 'Funciones del Sistema de Archivos', ), 'prev' => array ( 0 => 'function.stat.php', 1 => 'stat', ), 'next' => array ( 0 => 'function.tempnam.php', 1 => 'tempnam', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'es', '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 — Crea un enlace simbólico
symlink() crea un enlace simbólico al objetivo
target
existente con el nombre especificado en
link
.
target
Objetivo del enlace.
link
El nombre del enlace.
Versión | Descripción |
---|---|
5.3.0 | Esta función ahora es compatible con las plataformas Windows (Vista, Server 2008 o superior). |
Ejemplo #1 Crear un enlace simbólico
<?php
$objetivo = 'subidas.php';
$enlace = 'subidas';
symlink($objetivo, $enlace);
echo readlink($enlace);
?>
Nota: Los usuarios de Windows deberían observar que esta función sólo funcionará si el sistema donde se ejecuta PHP es Windows Vista/Windows Server 2008 o superior. Las versiones anteriores de Windows no admiten enlaces simbólicos.