Home >Backend Development >PHP Tutorial >str_replaced函数的有关问题

str_replaced函数的有关问题

WBOY
WBOYOriginal
2016-06-13 12:24:31743browse

str_replaced函数的问题?

<br />$bodytext = str_replace("%body%", "black", "<body text='%body%'>");<br />var_dump($bodytext);<br />echo str_replace("world","John","Hello world!");<br />

输出

为什么var_dump($bodytext)会输出string(19) "";是那里错了?设置还是语法?
------解决思路----------------------
$bodytext = str_replace("%body%", "black", "<body text='%body%'>");<br />var_dump($bodytext);
string(19) "

"

你只看到 string(19) ""  的原因是:你用浏览器查看时, 被当做 html 标记解释了,所以看不见
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn