안녕하세요 어쩌면 자동으로 PHP는 test.txt
에 파일의 이름을 변경 시도와 wampserver 2를 사용하고는 인코딩 .html 중에서 파일이. htmlentitydecode();
<?php
$orig = "I'll \"walk\" the <b>dog</b> now";
$a = htmlentities($orig);
$b = html_entity_decode($a);
echo $a; // I'll "walk" the <b>dog</b> now
echo $b; // I'll "walk" the <b>dog</b> now
// For users prior to PHP 4.3.0 you may do this:
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);
echo $c; // I'll "walk" the <b>dog</b> now
?>
출처
2011-10-06 19:24:40
Mob
사용은 아마 당신은 우리에게 당신이 검색하려는 텍스트의 일부를 제공 할 수 있습니다. –
예제에서 더 명확하게 test.html 파일을 추가합니다. –
코드를 tryed했지만 괜찮을 것 같습니다. 나에게 함수는 "<"문자를 반환합니다. 당신이 실제로 보는 것에 대해 더 명백하게 나타낼 수 있습니까? 내 말은 ... 끈을 에코 할 때, 이거 보여? < div < 시험 </div < –