title: Comparing strings in PHP the same way MySQL does
body: <p>I'm storing a varchar in a utf8 MySQL table and using utf8_general_ci collation.  I have a unique index on the varchar. I'd like to do a string comparison in PHP that is equivalent to what MySQL will do on the index.  </p>
  
  <p>A specific example is that I'd like to be able to detect that 'a' is considered equivalent to 'À' in PHP before this happens:</p>
  
  <pre><code>mysql&gt; insert UniTest (str) values ('a');                                   
  Query OK, 1 row affected (0.00 sec)
  
  mysql&gt; insert UniTest (str) values ('À');                                   
  ERROR 1062 (23000): Duplicate entry 'À' for key 1
  </code></pre>