Thursday, September 30, 2010

PHP get absolute path of file

To get the absolute path of a php file add:

<?php
$path = getcwd();
echo $path;
?>

Be aware:

This will give you the absolute path of the file in the file structure, not the URL!

0 comments:

Post a Comment