note 78227 added to function.basename
| From: | michael at dmgx dot com | Date: | Wed, 03 Oct 2007 16:42:12 +0000 |
| Subject: | note 78227 added to function.basename | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-131043@lists.php.net to get a copy of this message | ||
If you need the suffix try this.
baseSuffix ($path)
{
return array_pop( explode('.', $path)));
}
Here's a test for common image format extensions
/**
* @return boolean
*/
function typeOfImage( $path )
{
return in_array( array_pop( explode('.', $path)), array('gif', 'jpg',
'jpeg', 'png'));
}
----
Server IP: 209.41.74.194
Probable Submitter: 71.203.202.234
----
Manual Page -- http://www.php.net/manual/en/function.basename.php
Edit -- https://master.php.net/note/edit/78227
Del: integrated -- https://master.php.net/note/delete/78227/integrated
Del: useless -- https://master.php.net/note/delete/78227/useless
Del: bad code -- https://master.php.net/note/delete/78227/bad+code
Del: spam -- https://master.php.net/note/delete/78227/spam
Del: non-english -- https://master.php.net/note/delete/78227/non-english
Del: in docs -- https://master.php.net/note/delete/78227/in+docs
Del: other reasons-- https://master.php.net/note/delete/78227
Reject -- https://master.php.net/note/reject/78227
Search -- https://master.php.net/manage/user-notes.php