note 52438 added to reserved.variables
| From: | Stor_m at gmail dot com | Date: | Sun, 01 May 2005 14:01:08 +0000 |
| Subject: | note 52438 added to reserved.variables | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88835@lists.php.net to get a copy of this message | ||
Hi there people,
Is there a way of just getting the full path with the dir name?
i have
<?php
$path = __FILE__;
if (substr( $path, -4 ) == '.php')
{
$path = substr( $path, 0, -8 );
}
echo $path;
?>
but if the filename is over 4 charachters long, it prints out something like "http://dhost.info/jps/xtr3m3/i" for index.php,
please tell me how i can get the dir name
----
Manual Page -- http://www.php.net/manual/en/reserved.variables.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52438
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52438&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52438&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52438&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52438&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52438&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52438&report=yes
Search -- http://master.php.net/manage/user-notes.php