更新时间:2023-02-26 10:27:59
无需使用正则表达式.可以做到这一点:
No need to use regex. This will do it:
$extension_pos = strrpos($filename, '.'); // find position of the last dot, so where the extension starts
$thumb = substr($filename, 0, $extension_pos) . '_thumb' . substr($filename, $extension_pos);