(PHP 4, PHP 5, PHP 7, PHP 8)
is_link — Tells whether the filename is a symbolic link
filename
Path 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().