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
세상에서 가장 현명한 사람은 모든 사람으로부터 배울 수 있는 사람이요, 가장 사랑받는 사람은 모든 사람을 칭찬하는 사람이요, 가장 강한 사람은 자신의 감정을 조절할 줄 아는 사람이다. (탈무드)