title: Apply logic to only certain keys in array using PHP's foreach
body: <p>My script outputs an array:</p>
  
  <pre><code>$person = array(
      'name' =&gt; 'bob',
      'age' =&gt; '27',
      'sex' =&gt; 'male',
      'weight' =&gt; 'fat'
      // ...etc.
  );
  </code></pre>
  
  <p>Sometimes the keys in <code>$person</code> have no values - and I want to check for this. However, I don't give a chicken nugget about <code>$person['age']</code> or <code>$person['weight']</code>, I only want to check the other keys in the array aren't empty:</p>
  
  <pre><code>foreach ($person as $key =&gt; $value) {
      if ( $key != 'age' || $key != 'weight' ) {
          if ( empty($value) ) {
              echo 'you dun goofed';
          }
      }
  }
  </code></pre>
  
  <p>Why isn't this working?</p>