Jump to: navigation, search

Php readlink

From w3cyberlearnings

Contents

PHP function readlink

This function returns the target of a symbolic link.

Syntax readlink

sym is a file or full path

readlink(sym);

Return

Return the symbolic target link or FALSE on error.

Example 1

Create a symbolic link

<?php  
symlink('/var/www/real.php', '/var/www/real.html');

?>

readlink

  • you don't need to provide the full path, but usually you need to.
  • note: this program runs at the same directory so that's why we do not need to have the full path.
<?php 
     echo readlink('real.html');
?>

Output

Get the target of a symbolic link

/var/www/real.php

Related Links


basename-- chgrp-- chmod-- chown-- clearstatcache-- copy-- delete-- dirname-- disk_free_space-- disk_total_space-- diskfreespace-- fclose-- feof-- fflush-- fgetc-- fgetcsv-- fgets-- fgetss-- file_exists-- file_get_contents-- file_put_contents- file-- fileatime-- filectime-- filegroup-- fileinode-- filemtime-- fileowner-- fileperms-- filesize-- filetype-- flock-- fnmatch-- fopen-- fpassthru-- fputcsv-- fputs-- fread-- fscanf-- fseek-- fstat-- ftell-- ftruncate-- fwrite-- glob-- is_dir-- is_executable-- is_file-- is_link-- is_readable-- is_uploaded_file-- is_writable-- is_writeable-- lchgrp-- lchown-- link-- linkinfo-- lstat-- mkdir-- move_uploaded_file-- parse_ini_file-- parse_ini_string-- pathinfo-- pclose-- popen-- readfile-- readlink-- realpath_cache_get-- realpath_cache_size-- realpath-- rename-- rewind-- rmdir-- set_file_buffer-- stat-- symlink-- tempnam-- tmpfile-- touch-- umask-- unlink--

Navigation
Web
SQL
MISC
References