note 56998 added to function.strstr
| From: | udi at why-not dot com | Date: | Wed, 21 Sep 2005 10:17:24 +0000 |
| Subject: | note 56998 added to function.strstr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-95526@lists.php.net to get a copy of this message | ||
If you have an upload form (input type="file") , and you want to pick up just the name of
the file, not the entire string (ie: "funnypic.jpg", and not "C:\\Documents and
Settings\\Default User\\Desktop\\funnypic.jpg")
use this:
strtolower( strrev( substr( strrev( $_GET["filename"] ),0,strpos( strrev(
$_GET["filename"] ),"\\" ) ) ) );
----
Manual Page -- http://www.php.net/manual/en/function.strstr.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+56998
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56998&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56998&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56998&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56998&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56998&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+56998&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56998&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+56998&report=yes
Search -- http://master.php.net/manage/user-notes.php