开发者

unexpected T_DOUBLE_ARROW [closed]

开发者 https://www.devze.com 2023-03-20 02:51 出处:网络
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time,or an extraordinarily narrow situation that is not generally applic
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 10 years ago.

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 )
  )
);
?>
0

精彩评论

暂无评论...
验证码 换一张
取 消