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
성공하느냐 실패하느냐는 다른 사람이 아닌 바로 내가 하는 일이다. 내가 바로 힘이다. 나는 내 앞의 장애물을 치울 수도 있고, 미로 속에서 길을 잃을 수도 있다. 내 선택, 내 책임 이다. 이기거나 지는 것은 오직 나만이 가진 내 운명의 열쇠에 달려있다. (알레인 맥스웰)