且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

PHP上传-文件名中的空格

更新时间:2022-02-24 08:14:06

只需使用 str_replace 用另一个字符串替换所有空格:

Simply use str_replace to replace all white spaces with another string:

$fileName = str_replace(" ", "_", $fileName);