note 77002 added to function.include
| From: | timfurry at osu1 dot php dot net | Date: | Thu, 09 Aug 2007 15:09:58 +0000 |
| Subject: | note 77002 added to function.include | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-129382@lists.php.net to get a copy of this message | ||
A small tweak to alex's getFilePath function allows it to work for Windows-based PHP as well:
<?php
$absPath = str_replace("\\", "/",
dirname($_SERVER['SCRIPT_FILENAME']));
?>
Windows recognizes a forward slash as a directory separator character.
Using $_SERVER['DOCUMENT_ROOT'] and similar solutions didn't seem to work for web
paths with internal symbolic links. Alex's function gets around that and works great.
----
Server IP: 208.69.120.35
Probable Submitter: 209.184.240.68
----
Manual Page -- http://www.php.net/manual/en/function.include.php
Edit -- https://master.php.net/note/edit/77002
Del: integrated -- https://master.php.net/note/delete/77002/integrated
Del: useless -- https://master.php.net/note/delete/77002/useless
Del: bad code -- https://master.php.net/note/delete/77002/bad+code
Del: spam -- https://master.php.net/note/delete/77002/spam
Del: non-english -- https://master.php.net/note/delete/77002/non-english
Del: in docs -- https://master.php.net/note/delete/77002/in+docs
Del: other reasons-- https://master.php.net/note/delete/77002
Reject -- https://master.php.net/note/reject/77002
Search -- https://master.php.net/manage/user-notes.php