错误一:
echo 'echo $rst4[$i]["tb_restore_content"]:<br>';echo $rst4[$i]['tb_restore_content']."<br><br>";echo 'echo $rst4[$i]["tb_restore_content"]的内容:<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 ';
运行结果
由于直接输出变量a时有些标签没有被解析,由于有给它加了双引号,又出现了以下错误
错误二
echo is_string($rst4[$i]['tb_restore_content']);echo "$rst4[$i]['tb_restore_content']";
结果
回复讨论(解决方案)
为什么呢,看不出来,找出原因了吗?
是很神奇!
对于错误一,神奇在于你没把问题说清楚
对于错误二,神奇在于你没按 php 书写规则书写
echo “$rst4[$i][‘tb_restore_content’]”;
应写作
echo “{$rst4[$i][‘tb_restore_content’]}”;
或
echo $rst4[$i][‘tb_restore_content’];
4本文¥来源gao!%daima.com搞$代*!码$网9
搞代gaodaima码
是很神奇!
对于错误一,神奇在于你没把问题说清楚
对于错误二,神奇在于你没按 php 书写规则书写
echo “$rst4[$i][‘tb_restore_content’]”;
应写作
echo “{$rst4[$i][‘tb_restore_content’]}”;
或
echo $rst4[$i][‘tb_restore_content’];
对,我一时间还没注意到
为什么呢,看不出来,找出原因了吗?
错误二好你所说,错误一的意思是一个字符串中有标签,但是我输出这个变量时它不解析,
是很神奇!
对于错误一,神奇在于你没把问题说清楚
对于错误二,神奇在于你没按 php 书写规则书写
echo “$rst4[$i][‘tb_restore_content’]”;
应写作
echo “{$rst4[$i][‘tb_restore_content’]}”;
或
echo $rst4[$i][‘tb_restore_content’];
错误二好你所说,错误一的意思是一个字符串中有标签,但是我输出这个变量时它不解析
那你把问题仔细的描述一下
如果涉及变量,要分别给出变量的值
是很神奇!
对于错误一,神奇在于你没把问题说清楚
对于错误二,神奇在于你没按 php 书写规则书写
echo “$rst4[$i][‘tb_restore_content’]”;
应写作
echo “{$rst4[$i][‘tb_restore_content’]}”;
或
echo $rst4[$i][‘tb_restore_content’];
错误二好你所说,错误一的意思是一个字符串中有标签,但是我输出这个变量时它不解析
0
那你把问题仔细的描述一下
如果涉及变量,要分别给出变量的值
比如
$a='<div style="color:gray;border:1px solid gray;margin:3px"><font color="red">【回复:sasasa】 </font>0 </i></div>2'
echo $a输出的是没有解析的字符串,还是,div还是div
echo '<div style="color:gray;border:1px solid gray;margin:3px"><font color="red">【回复:sasasa】 </font>0 </i></div>2'
则没有任何问题
有什么不对吗?