Skip to content
조회 수 10179 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

PHP) Example #1 HTML 엔티티 디코딩

<?php
$orig 
"I'll \"walk\" the <b>dog</b> now";

$a htmlentities($orig);

$b html_entity_decode($a);

echo 
$a// I'll &quot;walk&quot; the &lt;b&gt;dog&lt;/b&gt; now

echo $b// I'll "walk" the <b>dog</b> now


// PHP 4.3.0 이전 사용자는 이렇게 할 수 있습니다:
function unhtmlentities($string)
{
    
// 숫자 엔티티 치환
    
$string preg_replace('~&#x([0-9a-f]+);~ei''chr(hexdec("\\1"))'$string);
    
// 문자 엔티티 치환
    
$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

?>

 

 

로그인 후 댓글쓰기가 가능합니다.

?

List of Articles
번호 분류 제목 날짜 조회 수
1384 WindowsTip Windows ARP Spoofing 10 file 2013.03.29 11929
1383 유용한상식 메리츠화재 의료실버보험은 1 2013.03.29 6545
1382 유용한상식 내Mom같은 어린이 보험 1 2013.03.29 6431
1381 Server make ping with PHP(핑테스트) 11 2013.04.01 11141
1380 Server php) curl_setopt의 옵션 1 10 2013.04.02 12937
» Server PHP) Example #1 HTML 엔티티 디코딩 13 2013.04.02 10179
1378 Server 웹 페이지에 HTML5 동영상 컨트롤 추가 10 2013.04.02 9457
1377 Server 아파치 성능테스트 프로그램 1 file 2013.04.03 14033
1376 Server Proxy and hide ip address problem 1 1 2013.04.03 11999
1375 일상 농업인 확인서 2013.04.06 21541
Board Pagination Prev 1 ... 95 96 97 98 99 ... 235 Next
/ 235

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소