I’m working on an application where users are searched for by multiple different criteria. One of the available criteria is searching by name. Names are stored in the database with HTML characters stripped, eg. a ‘ is stored as '. The problem with this is that if a user searches by name inputting the regular english name, it looks for the english name rather than the HTML-stripped name in the database. I have tried using htmlspecialchars($string, ENT_QUOTES), but for some reason it won’t always replace the single quote correctly. Can anyone think of why this would happen, or recommend a better way? Thank you!
I’m working on an application where users are searched for by multiple different criteria.
Share
try using this
html_entity_decode($string)instead ofhtmlspecialchars($string, ENT_QUOTES);