I’m trying to get data from a POST form. When the user inputs "habláis", it shows up in view source as just "habláis". I want to convert this to "habláis" for purposes of string comparison, but both utf8_encode() and htmlentities() are outputting habláis, and htmlspecialchars() does nothing. I would use str_replace but it won’t recognize the á when it searches the string.
I’m using a charset of utf-8 consistently across pages. Any idea what’s going on?
I’m not sure if this is your problem, but are you calling
htmlentitieswith the UTF-8 parameter? I ask because that’s not its default:So you might want to try calling your function like this:
Does this solve your problem?