note 111415 added to function.dirname
| From: | YousefIsmaeilCliprz | Date: | Mon, 18 Feb 2013 02:39:28 +0000 |
| Subject: | note 111415 added to function.dirname | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-193668@lists.php.net to get a copy of this message | ||
You can get best root path if you want to call a file from you project paths.
Make sure this define in your www/index.php
or the core file that inside www/ root.
<?php
/**
* @def (string) DS - Directory separator.
*/
define("DS","/",true);
/**
* @def (resource) BASE_PATH - get a base path.
*/
define('BASE_PATH',realpath(dirname(__FILE__)).DS,true);
?>
You can call any file any time without any problems
<?php
include BASE_PATH.'inc/class.php';
?>
----
Server IP: 69.147.83.199
Probable Submitter: 31.214.75.11
----
Manual Page -- http://php.net/manual/en/function.dirname.php
Edit -- https://master.php.net/note/edit/111415
Del: integrated -- https://master.php.net/note/delete/111415/integrated
Del: useless -- https://master.php.net/note/delete/111415/useless
Del: bad code -- https://master.php.net/note/delete/111415/bad+code
Del: spam -- https://master.php.net/note/delete/111415/spam
Del: non-english -- https://master.php.net/note/delete/111415/non-english
Del: in docs -- https://master.php.net/note/delete/111415/in+docs
Del: other reasons-- https://master.php.net/note/delete/111415
Reject -- https://master.php.net/note/reject/111415
Search -- https://master.php.net/manage/user-notes.php