How To Fix Buggy PHP strip_tags Function Como a fixar buggy PHP função strip_tags
strip_tags() in PHP has several problems. strip_tags () em PHP tem vários problemas. It doesn’t recognize that css within the style tags are not document text. Ele não reconhece que dentro do estilo css tags não são documento texto. It will not remove HTML entities or content within script tags. Não irá remover conteúdo HTML ou entidades dentro script tags. strip_tags() fails for invalid HTML. strip_tags () falha para inválidos HTML. In short strip_tags() is not advisable to use except for trivial cases. Em suma strip_tags () não é aconselhável usar com excepção de casos triviais. The best solution I have come across is by uersoy at tnn dot net: A melhor solução é Cheguei em toda a uersoy em tnn dot net:
function html2txt($document){ $search = array('@função html2txt (US $ documento) ($ search = array ( '@@si', // Strip out javascript '@@ si ', / / Strip out javascript "@@siU', // Strip style tags properly '@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags '@Siu @ ', / / Faixa estilo tags corretamente' @ <[\ / \ !]*?[^<>]*?>si ', / / Retirar HTML tags' @@' // Strip multi-line comments including CDATA ); $text = preg_replace($search, '', $document); return $text; }@ '/ / Faixa multi-line, incluindo comentários CDATA); $ texto = preg_replace ($ busca,'', $ documento); retorno $ texto;)
Filed under Arquivado em Headline News Headline News , De How To How To , De PHP , De Programming Programação , De Web | |
| |
RSS 2.0 RSS 2,0 | |
Trackback this Article | este artigo |
Email this Article E-mail este artigo
You may also like to read Você pode também gosta de ler |




