note 86232 deleted from reserved.variables.server by danbrown
| From: | danbrown@php.net | Date: | Thu, 10 Sep 2009 16:26:26 +0000 |
| Subject: | note 86232 deleted from reserved.variables.server by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-160429@lists.php.net to get a copy of this message | ||
Note Submitter: werner
----
This is based on the post from 'emailfire at gmail dot com' (above)
If you only want to get the dir off the file you can use:
<?php
$this_dir = $_SERVER['SCRIPT_FILENAME'];
if (strpos($this_dir, basename($_SERVER['REQUEST_URI'])) !== false) $this_dir =
reset(explode(basename($_SERVER['REQUEST_URI']), $this_dir));
echo $this_dir;
?>