Home Tutorial Php Phpfiles PHP realpath() function and example

 
 

PHP realpath() function and example
Posted on: October 30, 2009 at 12:00 AM
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
<?php
echo realpath("aa.txt");
?>
Output
C:\xampp\htdocs\filehandling\aa.txt

Related Tags for PHP realpath() function and example :


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.