How to retrieve values from arrays and check if they match
<p>I am learning to program in php and I have a little problem.
I have two arrays:<br>
Array A:</p>

<pre><code>array(10){
           [0]: string(10) "2012-08-01"
           [1]: int 1
           [2]: string(10) "2012-08-03"
           [3]: int 1
           [4]: string(10) "2012-08-07"
           [5]: int 2
           [6]: string(10) "2012-08-09"
           [7]: int 2
           [8]: string(10) "2012-08-27"
           [9]: int 1
          }
</code></pre>

<p>Array B:</p>

<pre><code>array(4){
          [0]: string(10) "2012-09-04"
          [1]: string(10) "2012-09-06"
          [2]: string(10) "2012-09-08"
          [3]: string(10) "2012-09-10"
        }
</code></pre>

<p>I want to check if the first element from Array A equals the first element from Array B, if it does then write second element (in this case <code>1</code>) from array A to an new Array C (one dimensional) else don't write anything in an array C and next check if element with index 2 from an array A equals second element <code>[1]: string(10) "2012-09-06"</code> from an array B if so the write fourth element (<code>[3]: int 1</code>) from an array A to an array C etc. so an array C would have int elements only.
If someone could help me out how to sort this out please I would be very happy </p>
