Share on Google+Share on Google+

PHP realpath() function and example

In this part of the tutorial we will learn about the function realpath() in context of file handling. And also we will see the example related to the realpath() function

Syntax for PHP realpath() Function

string realpath(file_path)

  • realpath() function  returns  absolute path  from the root(/ in linux and c:\ in widow) in string form.
  • It  interprets  all the \ used for the relative  path and the symbolic link
  • Then returns the absolute path.
  • On failure it returns FALSE value.

PHP realpath() Function with Example

Code of PHP realpath() Function
echo realpath("aa.txt");


Posted on: October 30, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.