title: comparing arrays in php, without caring for the order
body: <p>I have two arrays, $a and $b here, and need to check if they contain exactly the same elements (independently of the order). I am thinking of using</p>
  
  <pre><code>if (sizeof($a)==sizeof($b) AND array_diff($a,$b)==array())
  {
  
  }
  </code></pre>
  
  <p>But I am new to PHP, so I wonder: Is there a better way?</p>
  
  <p>Since I need to use them as sets, maybe I should not use arrays at all but something else.</p>