PHP yardımı ile metin html özel gibi karakter ve diğerlerini silin nasıl?
.....
$newtext = html_entitiy_decode($your_text);
Sen ayrı kaldırmak lazım:
$newtext = str_replace(' ', '', $newtext);
Çok html tags kaldırmak isterseniz, kullanabilirsiniz:
$newtext = strip_tags($newtext);
.
Relevant Functions Reference:
html_entity_decode strong>
strip_tags strong>
str_replace strong>
Sen html_entity_decode a> ;-) ile denemek isteyebilirsiniz
Örneğin:
$html = "this is a text";
var_dump($html);
var_dump(html_entity_decode($html, ENT_COMPAT, 'UTF-8'));
Size verecektir:
string 'this is a text' (length=19)
string 'this is a text' (length=15)
Note that you might need to specify the third parameter -- the charset -- if you are not working with ISO-8859-1.
Kastettiği ise removing, burada bunu yapmak için nasıl:
preg_replace("/&#?[a-z0-9]{2,8};/i", "", $text_with_special_chars);
(Found at http://stackoverflow.com/questions/657643/how-to-remove-html-special-chars-in-php)
html_entity_decode daha fazla insan tarafından okunabilir bir şey karakterleri dönüştürmek için bak.