title: How to compare two array based on matched values and order in PHP?
body: <p>I have 2 array, I want to compare them by matched values and order and count of total eligible values.</p>
  
  <pre><code>$a = [A,B,C,D,E,F,G];
            | |     |
  $b = [B,A,C,D,F,E,G];
  </code></pre>
  
  <p>In this case the output should be <strong>3</strong> . How can I achieve this with top performance?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>I am not asking matched values only , values should matched at the same order as well.</p>