I\'m working on a feature which requires me to get the contents of a webpage, then check to see if certain text is present in that page. It\'s a backlink checking tool.
I'm not entirely sold on your belief that it is the encoding. PHP is going to internally store all its strings in the same format. Could you try this code? It will compare the ascii value of each character in both strings, which might reveal something you're not seeing by visually comparing the strings.
$str1 = ...;
$str2 = ...;
if(strlen($str1) != strlen($str2)) {
echo "Lengths are different!";
} else {
for($i=0; $i < strlen($str1); $i++) {
if(ord($str1[$i]) != ord($str2[$i]) {
echo "Character $i is different! str1: " . ord($str1[$i]) . ", str2: " . ord($str2[$i]);
break;
}
}
}