Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> encje numeryczne, Problem z odczytem
irekpil
post
Post #1





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 13.11.2008

Ostrzeżenie: (0%)
-----


Wiatjcie mam problem z encjami numerycznymi. Problem polega na tym, że jak ktoś wpisuje tekst do strony cudysłów i znak - zamieniają się na encje numeryczne. Próbowalem wszytkich funkcji by je zmienić przy odczycie z bazy MySQL by zmieniły się w znaki ale nic czami encja jest połączona z wyrazem.
Zastosowalem ta funkcje ale nie dział.
ze strony http://pl.php.net/manual/pl/function.html-entity-decode.php

function unhtmlentities($string)
{
// replace numeric entities
$string = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $string
);
$string = preg_replace('~&#([0-9]+);~e', 'chr("\\1")', $string
);
// replace literal entities
$trans_tbl = get_html_translation_table(HTML_ENTITIES
);
$trans_tbl = array_flip($trans_tbl
);
return strtr($string, $trans_tbl
);
}

$c = unhtmlentities($a
);

Proszę o pomoc
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 28.09.2025 - 19:29