主题:一个关于字符串输出的问题,希望大虾们指点下!
我是初学php的,问题问的比较丢人,大家不要仍砖头啊。
下面是代码:
<HTML>
<HEAD>
<TITLE>经典循环例子</TITLE>
</HEAD>
<BODY>
<?
for($counter = 1; $counter <= 9; $counter++) //循环6次
{
print("<font color=[color=FF0000]\"$counter\"[/color]F3000><B>counter is
$counter</B></font><BR>\n"); //打印6次
}
?>
</BODY>
</HTML>
上面红颜色的部分,输出时候变成这样了
[color=FF0000]<font color="1"F3000><[/color]B>counter is 1</B></font><BR>
<font color[color=FF00FF]="2"[/color]F3000><B>counter is 2</B></font><BR>
<font color="3"F3000><B>counter is 3</B></font><BR>
<font color="4"F3000><B>counter is 4</B></font><BR>
<font color="5"F3000><B>counter is 5</B></font><BR>
<font color="6"F3000><B>counter is 6</B></font><BR>
<font color="7"F3000><B>counter is 7</B></font><BR>
<font color="8"F3000><B>counter is 8</B></font><BR>
<font color="9"F3000><B>counter is 9</B></font><BR>
怎么把“ ” 去掉,让他正确显示,,比如 color=9F3000 请大虾指点
下面是代码:
<HTML>
<HEAD>
<TITLE>经典循环例子</TITLE>
</HEAD>
<BODY>
<?
for($counter = 1; $counter <= 9; $counter++) //循环6次
{
print("<font color=[color=FF0000]\"$counter\"[/color]F3000><B>counter is
$counter</B></font><BR>\n"); //打印6次
}
?>
</BODY>
</HTML>
上面红颜色的部分,输出时候变成这样了
[color=FF0000]<font color="1"F3000><[/color]B>counter is 1</B></font><BR>
<font color[color=FF00FF]="2"[/color]F3000><B>counter is 2</B></font><BR>
<font color="3"F3000><B>counter is 3</B></font><BR>
<font color="4"F3000><B>counter is 4</B></font><BR>
<font color="5"F3000><B>counter is 5</B></font><BR>
<font color="6"F3000><B>counter is 6</B></font><BR>
<font color="7"F3000><B>counter is 7</B></font><BR>
<font color="8"F3000><B>counter is 8</B></font><BR>
<font color="9"F3000><B>counter is 9</B></font><BR>
怎么把“ ” 去掉,让他正确显示,,比如 color=9F3000 请大虾指点