Returns the absolute path name.
Syntax: string realpath(string $path)
realpath() expands all symbolic links and resolbes references to ‘/./’ ,’/../’ and extra ‘/’ characters in the input path and returns the canonical absolute pathname
example
——-
1 2 3 4 |
<?php chdir('/vasanthan/mydoubts/'); echo realpath('./../../test/hello'); ?> |
Out put of the above as below
/test/hello
on windows realpath will change unix style paths to windows style
1 2 3 4 |
<? echo realpath('/windows/system32'); ?> |
C:\windows\system32