note 107461 added to function.pathinfo

From: Date: Fri, 10 Feb 2012 16:00:35 +0000
Subject: note 107461 added to function.pathinfo
Groups: php.notes 
Request: Send a blank email to php-notes+get-186055@lists.php.net to get a copy of this message
Use this function in place of pathinfo to make it work with UTF-8 encoded file names too <?php function mb_pathinfo($filepath) { preg_match('%^(.*?)[\\\\/]*(([^/\\\\]*?)(\.([^\.\\\\/]+?)|))[\\\\/\.]*$%im',$filepath,$m); if($m[1]) $ret['dirname']=$m[1]; if($m[2]) $ret['basename']=$m[2]; if($m[5]) $ret['extension']=$m[5]; if($m[3]) $ret['filename']=$m[3]; return $ret; } ?> ---- Server IP: 69.147.83.197 Probable Submitter: 81.30.4.83 ---- Manual Page -- http://www.php.net/manual/en/function.pathinfo.php Edit -- https://master.php.net/note/edit/107461 Del: integrated -- https://master.php.net/note/delete/107461/integrated Del: useless -- https://master.php.net/note/delete/107461/useless Del: bad code -- https://master.php.net/note/delete/107461/bad+code Del: spam -- https://master.php.net/note/delete/107461/spam Del: non-english -- https://master.php.net/note/delete/107461/non-english Del: in docs -- https://master.php.net/note/delete/107461/in+docs Del: other reasons-- https://master.php.net/note/delete/107461 Reject -- https://master.php.net/note/reject/107461 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#186055) next »