Home Tutorial Php Examples PHP Get Absolute Path

 
 

Share on Google+Share on Google+
PHP Get Absolute Path
Posted on: October 9, 2009 at 12:00 AM
Advertisement
The PHP Get Absolute Path example shows you how you can get the absolute path of any file.

This example shows you how you can get the absolute path of a file. We will use the dirname() function and then with the help of realpath() function we can get the absolute path of the file.

Code:

<?php//to know your absolute path

echo realpath(dirname("absolutepath.php"));

?>

Output:

/phpexample/absolutepath.php

Advertisement

Related Tags for PHP Get Absolute Path :


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.

Posted on: October 9, 2009

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com