我有PHP编写一些简单的代码,我不知道为什么它不会工作:(简单的PHP代码不起作用
的第一个PHP文件:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Title</title>
</head>
<body>
<?php include_once "php/codes.php"; ?>
<ul>
<?php echo "<li><a href='' class='".whereAmI("files")."'>YYYYY</a></li> ";?>
<li><a href=''>XXXX</a></li>
</ul>
</body>
</html>
而且第二个(codes.php):
<?php
$menu= array("privileges","files", "posts", "menu");
function whereAmI($addr){
foreach ($menu as $value) {
if($value===$addr) return "current";
}
}
的问题是,该网页无法显示任何东西,我不知道为什么
启用错误代码,你会看到为什么 – 2013-02-16 21:26:36
尝试在顶部坚持这你的代码:ini_set('error_reporting',E_ALL); – Stuart 2013-02-16 21:27:53
如果它没有执行,你要么有错误,要么你的环境没有被设置为正确执行php。 – datasage 2013-02-16 21:27:54