Oihana PHP

isSymlink.php

Table of Contents

Functions

isSymlink()  : bool
Tells whether a path is a symbolic link.

Functions

Tells whether a path is a symbolic link.

isSymlink(string $path) : bool

Thin wrapper around is_link(): returns false (never throws) for a regular file, a directory, or a non-existent path.

Parameters
$path : string

The path to test.

author

Marc Alcaraz (ekameleon)

since
1.2.0
example
use function oihana\files\isSymlink;

var_dump( isSymlink( '/var/www/current' ) ) ; // bool(true)
var_dump( isSymlink( '/etc/hosts' ) ) ;        // bool(false)
Return values
bool

true if $path is a symbolic link, false otherwise.

On this page

Search results