Posted
Filed under iphone

\r ==> \\r
\n ==> \\n
으로텍스트를 변경해줘야 한다.

그럼으로 다음과 같이 함수를 만들어 보았다.

/* json parsing \r \n 변경 */

 function json_text($str){

  $str =  str_replace("\r","\\r", $str);
  $str =  str_replace("\n","\\n",$str);

  return $str;

 }

2011/06/24 11:26 2011/06/24 11:26