note 33776 deleted from function.strrpos by didou
| From: | didou@php.net | Date: | Mon, 07 Jul 2003 15:33:18 +0000 |
| Subject: | note 33776 deleted from function.strrpos by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-51639@lists.php.net to get a copy of this message | ||
Note Submitter: me@mydomain.com
----
I'm new to this and I made a little tidbit that will take a pathname of a folder and find out
what it's parent folder is, or, find the path of what folder a file is in.
$up1=substr($path, 0, strrpos($path, '/'));
$path='c:/dir1/dir2/dir3'
returns: c:/dir1/dir2
$path='c:/dir1/filename.ext'
returns: c:/dir1