This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 days ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
不需要正则表达式,只需使用
str_replace()
。如果它只能向后工作,那么您将用下划线替换空格,这只能意味着
$name
中没有任何下划线可以首先替换,或者您正在搜索错误的变量...No need for regex, just use
str_replace()
.If it only works backwards, then you're replacing spaces with underscores, which can only mean that there aren't any underscores in
$name
to replace in the first place, or you're searching in the wrong variable...