Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个名为 products_5245_20130709_101812_2.xmlGkcW7B 的文件
我想将其重命名为 products_5245_20130709_101812_2.xml,删除 xml 之后的所有字符。
如何使用 preg_replace 或任何其他方法来完成?
提前致谢 ?
有什么问题
$filename = preg_replace('/\.xml.+$/','.xml',$filename);