Reputation: 50540
I am attempting to match a string I know to a web page title in php.
I have the following string:
ℛobinhood
I have a page title that looks like this:
ℛobinhood
but is actually encoded like this if I look at the <title>
element:
ℛobinhood
I'm not sure how to compare these two strings. How do I either convert the ℛ
to ℛ or the other way so that I can do a proper comparison?
Upvotes: 4
Views: 1869
Reputation: 3513
You can use htmlentites ( http://php.net/manual/en/function.htmlentities.php ) to convert to the entity version.
Upvotes: 1
Reputation: 65264
Use the multibyte string functions:
mb_* will have an encoding for HTML entities and (most likely) whatever encoding your string is in.
Upvotes: 1