title: Remove keys with false values from array in PHP
body: <p>I have an associative array with a whole pile of <code>true</code>/<code>false</code> values.</p>
  
  <p>I am trying to remove all keys where the values are <code>false</code>.</p>
  
  <p>So if the array is</p>
  
  <pre><code>array(
    'key1' =&gt; true,
    'key2' =&gt; false,
    'key3' =&gt; false,
    'key4' =&gt; true
  );
  </code></pre>
  
  <p>I want to end up with</p>
  
  <pre><code>array(
    'key1' =&gt; true,
    'key4' =&gt; true
  );
  </code></pre>
  
  <p>How would I do this?</p>