title: Using an If-else within an array
body: <p>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. So I have this:</p>
  <pre><code>&lt;?php
  $arrLayout = array(
      &quot;section1&quot; =&gt; array(
  
          &quot;wLibrary&quot; =&gt; array(
              &quot;title&quot; =&gt; &quot;XBMC Library&quot;,
              &quot;display&quot; =&gt; &quot;&quot;
          ),
  
          &quot;wControl&quot; =&gt; array(
              &quot;title&quot; =&gt; &quot;Control&quot;,
              &quot;display&quot; =&gt; &quot;&quot;
          )
          )
              )
  ?&gt;
  </code></pre>
  <p>What I want is this</p>
  <pre><code>&lt;?php
  
  $LibraryStatus='true'
  
  $arrLayout = array(
      &quot;section1&quot; =&gt; array(
  
                    if $LibraryStatus='true' (
  
          &quot;wLibrary&quot; =&gt; array(
              &quot;title&quot; =&gt; &quot;XBMC Library&quot;,
              &quot;display&quot; =&gt; &quot;&quot;
          ),
                    else blank.      
  
                if $ControlStatus='true' (
  
      &quot;wControl&quot; =&gt; array(
              &quot;title&quot; =&gt; &quot;Control&quot;,
              &quot;display&quot; =&gt; &quot;&quot;
          )
      )
              )
  ?&gt;
  </code></pre>
  <p>If its false then it will also be blank obviously. Is it possible to have an if then inside an array controlling another array? If so how would it work? This is just part of the array there are more options and sections I just took those out for simplicity as its easy to scale once I understand how to do it once.</p>