一个PHP小问题~

<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
$a=8;
$b=2;
if($a<$b)
{
    print ("a>b");
}
else
{
    print ("a<b");
}
?>

上面的代码中为什么不是输出a<b而是a?奇怪得很~
刚刚接触php,不知道是什么问题,请各位不吝赐教~

作者: zifeiyu-fish   发布时间: 2010-09-20

其实php输出到html的是
  1. a<b
复制代码
而<意味着html标记开始!
一般的浏览器容忍了后面的错误,且视为<b>标记了。。。

作者: alick   发布时间: 2010-09-20

alick


原来如此,多谢指教~

作者: zifeiyu-fish   发布时间: 2010-09-21