PHP & Others

input text 따옴표 처리

페이지 정보

본문

<input type="text" value="<?php echo htmlentities($myValue); ?>">


htmlspecialchars($myValue, ENT_QUOTES, 'UTF-8');

'&' (ampersand) becomes '&amp;'

'"' (double quote) becomes '&quot;' when ENT_NOQUOTES is not set.

''' (single quote) becomes '&#039;' only when ENT_QUOTES is set.

'<' (less than) becomes '&lt;'

'>' (greater than) becomes '&gt;'



htmlspecialchars 는 예약된 HTML 문자만 인코딩하는 반면 htmlentities 는 HTML 표현이 있는 모든 것을 변환합니다

관련자료

등록된 댓글이 없습니다.
Today's proverb
원만한 가정은 상호간의 희생 없이는 절대 영위(營爲)되지 못한다. 이 희생은 그것을 실행하는 사람을 위대하게 하며 아름답게 한다. (앙드레 지드)