让我们来编写一些PHP实用的脚本

作者:凯旋网络来源:凯旋网络
ernet Explorer</b></center>
<?php
} else {
?>
<h3>strpos must have returned false</h3>
<center><b>You are not using Internet Explorer</b></center>
<?php
}
?> 
中.国站长站

该脚本的输出可能是:

[中国站长站]

<h3>strpos must have returned no-false</h3>
<center><b>You are using Internet Explorer</b></center>

中.国站长站

和以上我们用一个 PHP 的 echo 语句来输出不同的是,我们跳出了 PHP 模式来直接写 HTML 代码。这里很值得注意的一点是,对于这两种情况而言,脚本的逻辑效率是相同的。在判断了 strpos() 函数的返回值是 TRUE 或是 FALSE,也就是判断了字符串 MSIE 是否被找到之后,最终只有一个 HTML 块被发送给浏览者。

Www^Chinaz^com

  • 广告推荐