PHP - How can I return true if the value of the table A is on the same position(index) than the value of the table B?
<p>I used the explode function and i'd like to do a test in order to know when the value of the table 1 is on the same index that the value of the table 2.</p>

<p>Example:</p>

<pre><code>$pizza1  = "piece1 piece2 piece3 piece4 piece5 piece6";
$piecesA = explode(" ", $pizza1);

$pizza2  = "piece7 piece8 piece9 piece10 piece11 piece12";
$piecesB = explode(" ", $pizza2);
</code></pre>

<p>I can compare the values but not the position: I don't know how can I say within the foreach this: if the two values are in the same position (index) return true...</p>

<p>for example: piece1 and piece7 are in the same index. (the index 0 of each table) </p>

<p>Can you please explain me how can I do this?</p>

<p>Thanks.</p>
