2007년 5월 14일 월요일

HTML::Entities 를 사용한 tag 인코딩

Result Description Entity Name Entity Number
" quotation mark " "
' apostrophe ' (does not work in IE) '
& ampersand & &
< less-than &lt; &#60;
> greater-than &gt; &#62;




아래는 샘픔
<p>test</p>
<p>Some text with "quotes" in it</p>
<p><img src="/images/picture.gif" alt="Alt text goes here"></p>


use HTML::Entities;

$a = "V&aring;re norske tegn b&oslash;r &#230res";
decode_entities($a);
encode_entities($a, "\200-\377");

댓글 없음:

댓글 쓰기