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
희망이란 본래 있다고도 할 수 없고 없다고도 할 수 없다. 그것은 마치 땅 위의 길과 같은 것이다. 본래 땅 위에는 길이 없었다. 걸어가는 사람이 많아지면 그것이 곧 길이 되는 것이다. (노신의 “고향“중에서)