title: How do I conditionally include element in array in PHP?
body: <p>I am wondering how I can conditionally either have an array element or not at all using the following style. I realise in a general sense to do this would be  trivial...
  So What I would really like is to be able to not have a particular element at all based on some condition, so far I can make it one value or another.</p>
  
  <p>The actual motivation behind my question is to conditionally show or not show an <code>[ActionColumn][1]</code> in <code>Yii2</code>. But am more curious in a general sense now.</p>
  
  <p>Thanks!</p>
  
  <pre><code>&lt;?php
  $middle_name = "James";
  $full_name = [
      'Robert',
      (!empty($middle_name)) ? $middle_name : 'NA',
      'Fischer',
  ];
  ?&gt;
  </code></pre>