encoding - Encode different characters correct with PHP -
i'm trying show different characters right way when i'm scrapping website. @ moment i'm trying detect type of encoding text encoded with, doesn't work example romanian characters.
anyone knows solution encode special characters right way without getting weird html signs î etc.
i've tried
if(mb_detect_encoding($data['description']) == 'utf-8'){ header('content-type: text/html; charset=utf-8'); }else{ header('content-type: text/html; charset=iso-8859-1'); } $description = htmlspecialchars($data['description']); $description = htmlentities($data['description']); $description = html_entity_decode($data['description']); to detect charset, doesn't work on characters, of them.
Comments
Post a Comment