PHP readlink() Function
In this chapter you will learn:
- Definition for PHP readlink() Function
- Syntax for PHP readlink() Function
- Parameter for PHP readlink() Function
- Return for PHP readlink() Function
- Note for PHP readlink() Function
- Example - returns the target that the link points to
Definition
The readlink() function returns the target of a symbolic link.
Syntax
PHP readlink() Function has the following syntax.
readlink(linkpath)
Parameter
Parameter | Is Required | Description |
---|---|---|
linkpath | Required. | Link path to check |
Return
This function returns the target of the link on success, or FALSE on failure.
Note
This function is not implemented on Windows platforms.
Example
PHP readlink() function takes a link name and returns the target that the link points to.
<?php
$target = readlink("/home/andrew/myfile.txt");
print $target;
?>
Next chapter...
What you will learn in the next chapter:
- Definition for PHP realpath() Function
- Syntax for PHP realpath() Function
- Parameter for PHP realpath() Function
- Return for PHP realpath() Function
- Example - Get the real path for a relative path
Home » PHP Tutorial » PHP File Functions