Created
April 2, 2013 14:32
-
-
Save gabrieledarrigo/5292665 to your computer and use it in GitHub Desktop.
Convert accented charcter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$str = "una qualsiasi stringa in UTF-8"; | |
$str = trim($str); // elimina spazi all'inizio e alla fine della stringa | |
$str = strip_tags($str); // elimina i tag HTML | |
$str = utf8_decode($str); // da UTF-8 a ISO-8859-1 | |
$str = html_entity_decode($str, ENT_QUOTES, "UTF-8"); // decodifica tutti i caratteri in HTML a caratteri semplici, e riporta la stringa in UTF-8 | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment