note 81181 deleted from function.basename by nlopess
| From: | nlopess@php.net | Date: | Sun, 17 Feb 2008 16:01:33 +0000 |
| Subject: | note 81181 deleted from function.basename by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-136223@lists.php.net to get a copy of this message | ||
Note Submitter: alban.lopez at gmail.com
----
To UTF-8 capability use this function to get round basename restriction.
<?php
function UTF8basename($str)
{// for UTF-8 compatible
$str = explode('/', $str);
$name='';
while ($name=='') $name=array_pop($str);
return $name;
}
function UTF8dirname($str)
{// for UTF-8 compatible
array_pop($str = explode('/', $str));
return implode($str);
}
?>
http://ajaxbrowser.free.fr/