태그부분에 the man's car 라고 입력하면 the man\car 이렇게 입력되고 출력이 됩니다.
본문
질문:
태그부분에 the man's car 라고 입력하면 the man\car 이렇게 입력되고 출력이 됩니다.
그리고 다시 한 번 수정하면 the man\\car 라고 수정할 때 마다 \ 한 개씩 더 추가가 됩니다.
그래서 아래와 같이 코드를 수정해 보았는데 원하는 결과 값 the man's car 가 출력이 안됩니다.
어떻게 하면 되나요?
감사합니다.
<!-- 추가 시작 -->
<?php
$as_tag = addslashes($as_tag);
?>
<!-- 추가 끝 -->
<input type="text" name="as_tag" id="as_tag" value="<?php echo isset($write['as_tag']) ? $write['as_tag'] : ''; ?>" class="form-control" placeholder="콤마(,)로 구분하여 복수 태그 등록 가능">
답변 3
<input type="text" name="as_tag" id="as_tag" value="<?php echo isset($write['as_tag']) ? htmlspecialchars($write['as_tag'], ENT_QUOTES, 'UTF-8') : ''; ?>" class="form-control" placeholder="콤마(,)로 구분하여 복수 태그 등록 가능"> 이렇게 수정해서 시도했는데 안됩니다.
<input type="text" name="as_tag" id="as_tag" value="<?php echo isset($write['as_tag']) ? str_replace("'", "'", htmlspecialchars($write['as_tag'], ENT_QUOTES, 'UTF-8')) : ''; ?>" class="form-control" placeholder="콤마(,)로 구분하여 복수 태그 등록 가능">
위와 같이 수정해서 해보았는데 안됩니다.