2017-01-15 24 views
0

をすることはできません。PHP - 私はこのコードを持っている連想配列

menu.php

<?php 
$menu = [ 
    [ 
     "id"->"home", 
     "name"->"Home page", 
     "url"->"/index.php" 
    ] 
}; ?> 

のindex.php

<?php 
require 'menu.php'; 
$menubar = [ 
    "menu" -> $menu, 
    "current" -> "home" // this line 
]; ?> 
<!-- and some html --> 

そして、もちろん、それはないですがワーキング。

解析エラー:

syntax error, unexpected '"home"' (T_CONSTANT_ENCAPSED_STRING), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in D:\xampp\htdocs\index.php on line 11`

これを修復する方法は? ); -

答えて

関連する問題