PHP: get absolute path to current folder / directory

 

PHP: get absolute path to current folder / directory

The simple way :

Use php function getcwd like this:

$base_folder = getcwd();

result in $base_folder is string to current path/folder without end trail, / .

or use php constant called __FILE__

define(’ABSLPATH’, dirname(__FILE__).’/’);

where ABSLPATH contains a string with end trail /.

Example for use:

require_once(ABSPATH.’wp-settings.php’);


Post a Comment



Entertainment Directory of Entertainment Blogs Blog Directory Scouter for YouTube Widescreen, in format de 16/9 ; Facts and Myths about Power Supply - PC ; American Music Awards 2008 - The Winners Today.com Entertainment Blogs
TopOfBlogs blog search directory Add to Technorati Favorites Blogverzeichnis - Blog Verzeichnis bloggerei.de Entertainment blogs Bloggers and Blogging Blogs - BlogCatalog Blog Directory Entertainment Blogs - Blog Top Sites
Blog DigNow.org The House Of Blogs, directorio de blogs BlogESfera Directorio de Blogs Hispanos - Agrega tu Blog BlogRankers.com Blog Directory & Search engine directorio web blogarama - the blog directory
blog directory PodNova Listed in LS Blogs the Blog Directory and Blog Search Engine