unexpected T_DOUBLE_ARROW [closed]
Hi I'm getting an unexpected T_DOUBLE_ARROW on line 13. I know it seems like quite a complicated set of arrays but it needs yo be like this. There are probably more errors later on also. Please could someone explain my mistake. Thanks
<?php
$LibraryStatus = true;
$ControlStatus = true;
$HDDStatus = true;
$arrLayout = array(
"section1" => arra开发者_如何学Goy(
($LibraryStatus ? array("wLibrary" => array("title" => "Library",
"display" => "")) : false),
($ControlStatus ? ("wControl" => array("title" => "Control",
"display" => "")) : false)),
"section2" => array(
($HDDStatus ? array("whdd" => array("title" => "HDD",
"display" => "")) : false)));
?>
Missing array
here:
($ControlStatus ? ("wControl" => ...
Should be:
($ControlStatus ? array("wControl" =>...
You were missing "array" in one of your conditionals:
<?php
$LibraryStatus = true;
$ControlStatus = true;
$HDDStatus = true;
$arrLayout = array(
"section1" => array(
( $LibraryStatus ?
array(
"wLibrary" => array(
"title" => "Library" ,
"display" => ""
)
) :
false ) ,
( $ControlStatus ?
array( /* This was the missing "array" */
"wControl" => array(
"title" => "Control" ,
"display" => ""
)
) :
false )
) ,
"section2" => array(
( $HDDStatus ?
array(
"whdd" => array(
"title" => "HDD" ,
"display" => ""
)
) :
false )
)
);
?>
精彩评论