Using an If-else within an array

后端 未结 10 1952
滥情空心
滥情空心 2020-12-11 04:45

Hi guys I have no idea if this is possible or if there is another way of doing it but any help would be appreciated. What I\'m trying to do is turn off arrays individually.

10条回答
  •  星月不相逢
    2020-12-11 05:10

    In a way, yes.

    You can't place it where you've asked (directly after the opening of an array) You can't use an if statement. You can use ternary (condition) ? true : false

     ($LibraryStatus == 'true') ? array("wLibrary" => array("title" =>     "Title","display" => "")) : array()  
    );
    
    ?>
    

提交回复
热议问题