note 39900 added to function.strrev
| From: | webmaster__AT__digitalanime__DOT__nl at rn2 dot php dot net | Date: | Sat, 14 Feb 2004 19:30:01 +0000 |
| Subject: | note 39900 added to function.strrev | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-65149@lists.php.net to get a copy of this message | ||
Just to let you guys know why this function can be usefull.. If you need to check what the _REAL_
extension of a file is, you can use this:
<?php
function return_extension($file)
{
$file = strrev($file);
$file = explode('.', $file);
return strrev($file[0]);
}
?>
This just reverses the filename, explodes it by the '.' and returns the reversed result,
so you won't get stuck with 'config.inc.php' etcetera.
Just to let you know :-)
----
Manual Page -- http://www.php.net/manual/en/function.strrev.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39900
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39900&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39900&report=yes
Search -- http://master.php.net/manage/user-notes.php