-2

可能重复:
在 PHP 中使用 URL 突出显示当前导航选项卡

在没有 php 扩展的情况下调整当前选项卡不起作用

<?php if ("index.php" || "index"==$Current) 
  {echo "selected";}else {echo "";}?>
4

2 回答 2

0

我想你想要:

<?php if ("index.php"==$Current || "index"==$Current) {
          echo "selected";
      }else {
          echo "";
      }
?>

你写的真的没有意义。

于 2012-05-24T04:44:48.760 回答
0

这段代码

if ("index.php" || "index"==$Current) 

已经返回 true 因为

if ("index.php") 

相同的

if ("index.php" != "")
于 2012-05-24T04:48:18.897 回答