970_90

Wednesday, 1 October 2014

realpath - Get the Real path of File with PHP

string realpath ( string $path )
Returns canonicalized absolute pathname
realpath() expands all symbolic links and resolves references to '/./', '/../' and extra '/' characters in the input path and return the canonicalized absolute pathname.

<?php
chdir
('/var/www/');
echo 
realpath('./../../etc/passwd');?>

5.3.0 Prior to this release, if only the last path component did not exist, realpath() would not fail on *BSD systems. realpath() now fails in this case. 5.0.0 Prior to this release, a blank or NULL path would cause realpath() to return the directory name of the script.

2 PHP Directives to Boost Your Magento Performance

No comments:

Post a Comment