Created
October 27, 2013 07:45
-
-
Save WenLiangTseng/7178911 to your computer and use it in GitHub Desktop.
解決檔案上傳時,PHP的basename函數不支援中文的方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//php自帶的basename函數不支持中文,下面這個方法是最簡單的實現。 | |
function get_basename($filename){ | |
return preg_replace('/^.+[\\\\\\/]/', '', $filename); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment