title: Check if all array elements are set
body: <p>I have the following array:</p>
  
  <pre><code>$my_array = array ( 
                   'city'     =&gt; $this-&gt;input-&gt;post('city'),
                   'country'  =&gt; $this-&gt;input-&gt;post('country'),
                   'state'    =&gt; $this-&gt;input-&gt;post('state'),
                   'miles'    =&gt; $this-&gt;input-&gt;post('miles')
                   );
  </code></pre>
  
  <p>Which <strong>short</strong> php function or method can I use to check if all array items are set? Right now I'm using the following code</p>
  
  <pre><code>$my_array = array_filter($my_array);
  
  if (!empty($my_array['city']) &amp;&amp; !empty($my_array[['miles']) &amp;&amp; !empty($my_array[['state']) &amp;&amp; !empty($my_array['country']))
  {
       //do something
  }
  </code></pre>
  
  <p>note: I'm using the <code>array_filter()</code> function to remove all entries from a query that equal  FALSE.</p>