note 119468 added to function.pathinfo
| From: | 498936940 at qq dot com | Date: | Wed, 15 Jun 2016 03:02:35 +0000 |
| Subject: | note 119468 added to function.pathinfo | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-205724@lists.php.net to get a copy of this message | ||
Note:
pathinfo() is locale aware, so for it to parse a path containing multibyte characters correctly, the
matching locale must be set using the setlocale() function.
Reality:
var_dump(pathinfo('ä¸å½äºº2016.xls'));
exit();
array(4) { 'dirname' => string(1) "." 'basename' => string(8)
"2016.xls" 'extension' => string(3) "xls" 'filename'
=> string(4) "2016" }
Expect(Solve):
setlocale(LC_ALL, 'zh_CN.UTF-8');
var_dump(pathinfo('ä¸å½äºº2016.xls'));
exit();
array(4) { 'dirname' => string(1) "." 'basename' => string(17)
"ä¸å½äºº2016.xls" 'extension' => string(3) "xls"
'filename' => string(13) "ä¸å½äºº2016" }
----
Server IP: 72.52.91.14
Probable Submitter: 114.222.206.34
----
Manual Page -- http://php.net/manual/en/function.pathinfo.php
Edit -- https://master.php.net/note/edit/119468
Del: integrated -- https://master.php.net/note/delete/119468/integrated
Del: useless -- https://master.php.net/note/delete/119468/useless
Del: bad code -- https://master.php.net/note/delete/119468/bad+code
Del: spam -- https://master.php.net/note/delete/119468/spam
Del: non-english -- https://master.php.net/note/delete/119468/non-english
Del: in docs -- https://master.php.net/note/delete/119468/in+docs
Del: other reasons-- https://master.php.net/note/delete/119468
Reject -- https://master.php.net/note/reject/119468
Search -- https://master.php.net/manage/user-notes.php