I am trying to compare two strings using == and/or strcmp(). I have no problem until the strings I am comparing have an apostrophe in them. Both strings have been placed into separate arrays. Both strings are simple, example: who's or they're. One string is coming from a $_POST variable the other is coming from a MySQL Database.
Code looks like this:
Code: Select all
$aWordArray[0]=trim($_POST['a1']);
.........$ws = mysql_fetch_array........
$cWordArray[0]=$ws[1];
if ($aWordArray[0]==$cWordArray[0]) ....
or
if (strcmp($aWordArray[0], $cWordArray[0])) ......
Thanks for any help!