更新时间:2023-01-22 19:25:17
使用 str_replace
:
$str = str_replace(array(' ', '<', '>', '&', '{', '}', '*'), array('-'), $str);
注意:
如果 replace 的值少于 search ,则将空字符串用于其余替换值.
If replace has fewer values than search, then an empty string is used for the rest of replacement values.