How can i make this comparison return true?
$var1="á";
$var2="á";
if ($var1==$var2) {
return true;
}
The funny thing is that i dont know if the html entity is in var1 or in var2, so i need to put the same function in both sides of the comparison.
I tried with html_entity_decode, htmlentities and a combination of both.
Any ideas?
Thanks!
Can’t you just use an
orcomparison in your if statement? If either$var1or$var2is a HTML entity, it should return true nicely.If you might have them in boht or either field, you could add in a third comparison like this: