readlink

(PHP 4, PHP 5, PHP 7)
Returns the target of a symbolic link
string readlink ( string $path )

readlink() does the same as the readlink C function.

Parameters:
path

The symbolic link path.

Returns:

Returns the contents of the symbolic link path or FALSE on error.

Changelog:
5.3.0

This function is now available on Windows platforms (Vista, Server 2008 or greater).

Examples:
readlink() example
1
2
3
4
5
6
<?php
 
// output e.g. /boot/vmlinux-2.4.20-xfs
echo readlink('/vmlinuz');
 
?>
See also:

is_link() -

symlink() -

linkinfo() -

doc_php
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.