json 사용시 엔터(newline) 넘길때 에러나는 경우
페이지 정보
작성자
본문
function parse($text) {
// Damn pesky carriage returns...
$text = addslashes($text);
$text = str_replace("\r\n", "\n", $text);
$text = str_replace("\r", "\n", $text);
// JSON requires new line characters be escaped
$text = str_replace("\n", "\\n", $text);
return $text;
}
댓글목록
등록된 댓글이 없습니다.