title: PHP - Mutidimensional array diff
body: <p>i would like to ask for your help since I'm having difficulty resolving this matter. I had created a function to facilitate on array diff but it does not suffice to my needs. Thanks and more power!</p>
  
  <pre><code>&lt;?php
     $arraySession = array(
        'sampleA' =&gt; array('1', '2', '3'),
        'sampleB' =&gt; array('1', '2', '3'),
     );
  
  $arrayPost = array(
      'sampleA' =&gt; array('1'),
      'sampleB' =&gt; array('1','2'),
  );
  </code></pre>
  
  <p>result should be:</p>
  
  <pre><code>array(
     'sampleA' =&gt; array('2', '3')
     'sampleB' =&gt; array('3'),
  )
  </code></pre>
  
  <p>my existing function:</p>
  
  <pre><code>    public function array_diff_multidimensional($session, $post) { 
        $result = array();
        foreach($session as $sKey =&gt; $sValue){
            foreach($post as $pKey =&gt; $pValue) {
                if((string) $sKey == (string) $pKey) {
                    $result[$sKey] = array_diff($sValue, $pValue);
                } else {
                    $result[$sKey] = $sValue;
                }
            }
        }
        return $result;
      }
  </code></pre>
  
  <p>Any help would be much appreciated! Happy coding!</p>