note 33776 added to function.strrpos
| From: | me at mydomain dot com | Date: | Mon, 07 Jul 2003 15:08:36 +0000 |
| Subject: | note 33776 added to function.strrpos | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-51637@lists.php.net to get a copy of this message | ||
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
----
Manual Page -- http://www.php.net/manual/en/function.strrpos.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33776
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33776&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33776&report=yes