PHP/PHP함수
addslashes()
자연과벗하다
2017. 12. 24. 03:30
addslashes()
: sql 오류를 막음. 오류를 일으키는 문자를 익스케이핑함 (\를 추가함);
<?php
header("Content-Type: text/html; charset=UTF-8");
$string = '"사과","귤","감","밤"';
$result = addslashes($string);
print $result;
?>
결과:
\"사과\",\"귤\",\"감\",\"밤\"