我试图替换字符串中的单词但是我想在函数中找到单词并将其替换为带有确切长度的星号的单词?
这是可能的还是我需要以其他方式做到这一点?
$text = "Hello world, its 2018"; $words = ['world', 'its']; echo str_replace($words, str_repeat("*", count(FOUND) ), $text);
php replace str-replace
php ×1
replace ×1
str-replace ×1