", "", $string); $txt = str_replace("", "", $txt); $txt = str_replace("", "", $txt); $txt = str_replace("", "", $txt); $txt = str_replace("", "", $txt); $txt = str_replace("", "", $txt); $txt = str_replace("", "", $txt); $txt = str_replace("", "", $txt); $txt = strip_tags($txt); $txt = str_replace(chr(13).chr(10), "", $txt); /* $txt=str_replace(" "," ",$txt); $txt=str_replace("Á","Á",$txt); $txt=str_replace("á","á",$txt); $txt=str_replace("É","É",$txt); $txt=str_replace("é","é",$txt); $txt=str_replace("Í","Í",$txt); $txt=str_replace("í","í",$txt); $txt=str_replace("Ó","Ó",$txt); $txt=str_replace("ó","ó",$txt); $txt=str_replace("Ú","Ú",$txt); $txt=str_replace("ú","ú",$txt); $txt=str_replace("Ñ","Ñ",$txt); $txt=str_replace("ñ","ñ",$txt); $txt=str_replace("à","à",$txt); $txt=str_replace("À","À",$txt); $txt=str_replace("¡","¡",$txt); $txt=str_replace("·","·",$txt); $txt=str_replace("Ç","Ç",$txt); $txt=str_replace("ç","ç",$txt); $txt=str_replace(""",'"',$txt); $txt=str_replace("ª",'ª',$txt); $txt=str_replace("º",'º',$txt); $txt=str_replace("&",'&',$txt); $txt=str_replace("•",'•',$txt); $txt=str_replace("¿",'¿',$txt); $txt=str_replace("€",'EUR',$txt); $txt=str_replace("ü",'ü',$txt); $txt=str_replace("Ü",'Ü',$txt); $txt=str_replace("¨",'¨',$txt);*/ return $txt; } /** * Remove all html tag. * * @param string $string The string to be stripped of accents * * @return string clean of html tag */ function removeQuotes($string) { //$txt=strip_tags($cadena); $txt = str_replace(" ", " ", $string); $txt = str_replace("Á", "Á", $txt); $txt = str_replace("á", "á", $txt); $txt = str_replace("É", "É", $txt); $txt = str_replace("é", "é", $txt); $txt = str_replace("Í", "Í", $txt); $txt = str_replace("í", "í", $txt); $txt = str_replace("Ó", "Ó", $txt); $txt = str_replace("ó", "ó", $txt); $txt = str_replace("Ú", "Ú", $txt); $txt = str_replace("ú", "ú", $txt); $txt = str_replace("Ñ", "Ñ", $txt); $txt = str_replace("ñ", "ñ", $txt); $txt = str_replace(""", '"', $txt); $txt = str_replace("ª", 'ª', $txt); $txt = str_replace("º", 'º', $txt); $txt = str_replace("&", '&', $txt); $txt = str_replace("•", '•', $txt); $txt = str_replace("¿ &", '¿', $txt); $txt = str_replace("à", "à", $txt); $txt = str_replace("À", "À", $txt); $txt = str_replace("¡", "¡", $txt); $txt = str_replace("·", "·", $txt); $txt = str_replace("Ç", "Ç", $txt); $txt = str_replace("ç", "ç", $txt); $txt = str_replace("€", 'EUR', $txt); $txt = str_replace("ü", 'ü', $txt); $txt = str_replace("Ü", 'Ü', $txt); $txt = str_replace("uml;", '¨', $txt); return $txt; } /** * Returns an associative array (keys: R,G,B) from a hex html code (e.g. #3FE5AA). * * @param string $color * * @return array */ function hex2dec($color = '#000000') { $R = substr($color, 1, 2); $rouge = hexdec($R); $V = substr($color, 3, 2); $vert = hexdec($V); $B = substr($color, 5, 2); $bleu = hexdec($B); $tbl_couleur = []; $tbl_couleur['R'] = $rouge; $tbl_couleur['V'] = $vert; $tbl_couleur['B'] = $bleu; return $tbl_couleur; } /** * Conversion of pixel -> millimeter at 72 dpi. * * @param $px * * @return float|int */ function px2mm($px) { return $px * 25.4 / 72; } /** * Transform from HTML to text. * * @param string $html HTML string * * @return string Pure text version of the given string */ function txtentities($html) { $trans = get_html_translation_table(HTML_ENTITIES); $trans = array_flip($trans); return strtr($html, $trans); }