note 77002 deleted from function.include by danbrown
| From: | danbrown@php.net | Date: | Mon, 18 May 2009 00:58:29 +0000 |
| Subject: | note 77002 deleted from function.include by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-155457@lists.php.net to get a copy of this message | ||
Note Submitter: tim furry
----
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.