note 91074 added to function.strrchr
| From: | franzemmanuel at gmail dot com | Date: | Sun, 24 May 2009 00:30:57 +0000 |
| Subject: | note 91074 added to function.strrchr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-155914@lists.php.net to get a copy of this message | ||
this functions returns the full path of the current directory.
<?php
function CurrentFullPath()
{
$root = $_SERVER['DOCUMENT_ROOT'] ;
$self = $_SERVER['PHP_SELF'] ;
return $root.mb_substr($self,0,-mb_strlen(strrchr($self,"/"))) ;
}
echo CurrentFullPath() ;
/*
If path is $path = "/home/me/www/pictures/control.php" ;
It will return :
/home/me/www/pictures
*/
?>
----
Server IP: 213.246.51.26
Probable Submitter: 81.65.87.171
----
Manual Page -- http://www.php.net/manual/en/function.strrchr.php
Edit -- https://master.php.net/note/edit/91074
Del: integrated -- https://master.php.net/note/delete/91074/integrated
Del: useless -- https://master.php.net/note/delete/91074/useless
Del: bad code -- https://master.php.net/note/delete/91074/bad+code
Del: spam -- https://master.php.net/note/delete/91074/spam
Del: non-english -- https://master.php.net/note/delete/91074/non-english
Del: in docs -- https://master.php.net/note/delete/91074/in+docs
Del: other reasons-- https://master.php.net/note/delete/91074
Reject -- https://master.php.net/note/reject/91074
Search -- https://master.php.net/manage/user-notes.php