I am trying to compare rows from 2 PHP arrays like this...
if ($row1[$i] == $row2[$i]) {
echo 'Rows match';
} else {
echo 'Rows do not match';
}
This is working effectively till it comes throughout something that is encoded, so the apostrophe is a superb example. So the beneath 2 aren't the same...
This is an apostrophe'
This is an apostrophe'
I've tried the use of htmlspecialchars_decode to attempt to convert them earlier than evaluating but this isn't working. How can I compare those 2 rows?
1 Replies
Try html_entity_decode()
with ENT_QUOTES
flag
please go through with the below url:-
https://www.php.net/manual/en/function.html-entity-decode.php
html_entity_decode('This is an apostrophe'', ENT_QUOTES);