In case you're interested, here's a version that includes the &$count argument:function str_replace2($find, $replacement, $subject, $limit = 0, &$count = 0){ if ($limit == 0) return str_replace($find, $replacement, $subject, $count); $ptn = '/' . preg_quote($find,'/') . '/'; return preg_replace($ptn, $replacement, $subject, $limit, $count);} 这篇关于PHP str_replace()是否具有限制参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 09-03 08:07