title: Setting a PHP array's value to 0 if its key does not exist as a value in another array
body: <p>Is there any kind of function or quick process for comparing two arrays in PHP in a way that if the value of one array exists as a key in the second array, the second array maintains its key's value, otherwise that key's value gets set to 0.</p>
  
  <p>For example,</p>
  
  <pre><code>$first_array = array('fred', 'george', 'susie');
  
  $second_array = array(
                  'fred' =&gt; '21', 
                  'george' =&gt; '13',     
                  'mandy' =&gt; '31',     
                  'susie' =&gt; '11'
      );
  </code></pre>
  
  <p>After comparing the two, ideally my final array would be:</p>
  
  <pre><code>Fred &gt; 21
  George &gt; 13
  Mandy &gt; 0 
  Susie &gt; 11
  </code></pre>
  
  <p>Where Mandy was set to 0 because the key didn't exist as a value in the first array…..</p>
  
  <p>I know it's probably kind of an odd thing to want to do!  But any help would be great.</p>