Home > Backend Development > PHP Tutorial > 【PHP字符串】今天遇到一个很神奇的有关问题,请大家帮忙

【PHP字符串】今天遇到一个很神奇的有关问题,请大家帮忙

WBOY
Release: 2016-06-13 12:25:22
Original
1013 people have browsed it

【PHP字符串】今天遇到一个很神奇的问题,请大家帮忙
错误一:

<br />echo 'echo $rst4[$i]["tb_restore_content"]:<br>';<br />echo $rst4[$i]['tb_restore_content']."<br><br>";<br />echo 'echo $rst4[$i]["tb_restore_content"]的内容:<br>';<br />echo '<font color="gray"><i><font color="red">【回复:sasasa】 </font><font color="gray"><i><font color="red">【回复:sasasa】 </font>0 </i></font><br/> 1 </i></font><br/> 2 ';<br />
Copy after login

运行结果

由于直接输出变量a时有些标签没有被解析,由于有给它加了双引号,又出现了以下错误
错误二
<br />echo is_string($rst4[$i]['tb_restore_content']);<br />echo "$rst4[$i]['tb_restore_content']";<br />
Copy after login

结果

------解决思路----------------------
为什么呢,看不出来,找出原因了吗?
------解决思路----------------------
是很神奇!
对于错误一,神奇在于你没把问题说清楚
对于错误二,神奇在于你没按 php 书写规则书写
echo "$rst4[$i]['tb_restore_content']";
应写作
echo "{$rst4[$i]['tb_restore_content']}";

echo $rst4[$i]['tb_restore_content'];

------解决思路----------------------
有什么不对吗?

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template