PHP str_replace $ 0存在吗? [关闭]

问题描述 投票:-1回答:1

str_replace可以用来替换找到的匹配项吗?

例如

str ='lol';

str_replace('l','$ 0',$ str);

我不想使用preg_replace。

php str-replace
1个回答
-1
投票
$str = 'lol';
$str = str_replace('l','$0',$str);
print_r($str);
© www.soinside.com 2019 - 2024. All rights reserved.