array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'function.is-link.php', 1 => 'is_link', 2 => 'Tells whether the filename is a symbolic link', ), 'up' => array ( 0 => 'ref.filesystem.php', 1 => 'Функції Файлової Системи', ), 'prev' => array ( 0 => 'function.is-file.php', 1 => 'is_file', ), 'next' => array ( 0 => 'function.is-readable.php', 1 => 'is_readable', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/filesystem/functions/is-link.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
is_link — Tells whether the filename is a symbolic link
filenamePath to the file.
Returns true if the filename exists and is a symbolic link, false
otherwise.
Під час збоїв буде видаватись E_WARNING.
Приклад #1 Create and confirm if a file is a symbolic link
<?php
$link = 'uploads';
if (is_link($link)) {
echo readlink($link);
} else {
symlink('uploads.php', $link);
}
?>Зауваження: Рузультати цієї функції кешуються. Докладніше: clearstatcache().
Починаючи з PHP 5.0.0, ця функція також може бути використана з деякими URL-обгортками. На сторінці Підтримувані протоколи та обгортки вказано, які обгортки підтримують сімейство функцій stat().