我使用ajax制作我网站的菜单栏,但菜单没有显示,我收到此错误:
PHP Parse error: syntax error, unexpected '[' in /home/mtahayac/public_html/ajax/ajax_render_menu.php on line 8
以下是代码:
equire_once("../functions/functions_logs.php");
//require_once '../functions/functions_player.php';
//Main menu
$menu = array();
//Home
array_push($menu, ["Home", "index.php", "_self"]);
//Forums
array_push($menu, ["Forums", "http://forum.mydomain.com", "_blank"]);
array_push($menu, ["Refer a friend", "refer-a-friend.php", "_self"]); //Referrer
//UCP
if(isset($_SESSION['username']) ){
array_push($menu, ["UCP", "ucp.php", "_self"]);
}
//Logs
if(isset($_SESSION['groups']) and canUserAccessLogs($_SESSION['groups'])){
array_push($menu, ["Logs", "logs.php", "_self"]);
}
//Library
array_push($menu, ["Library", "library.php", "_self"]);
array_push($menu, ["Statistics", "stats.php", "_self"]);
array_push($menu, ["Support Center", "support.php", "_self"]);
//Donate
array_push($menu, ["Donate", "donate.php", "_self"]);
if(!isset($_SESSION['username']) or !$_SESSION['username']){
array_push($menu, ["Register", "register.php", "_self"]); //Register
}
有什么想法吗?
感谢。