자바스크립트 escape()를 php로 쓰기
페이지 정보
작성자 MintState 댓글 0건 조회 15,046회 작성일 08-11-03 10:50본문
자바스크립트 escape()를 php로  쓰기
 
* 서버를 이용하는 방법
* php iconv 이용
* 그외
        
        * 서버를 이용하는 방법
function eucToutf($strValue) {
     $str = ereg_replace("\n","\\n",$strValue);  
     $str = exec('echo ''.$str.'' |iconv -c -f uhc -t utf-8');  
     return ereg_replace("\\\\n","\n",$str);  
}
function utfToeuc($strValue) {
     $str = ereg_replace("\n","\\n",$strValue);  
     $str = exec('echo ''.$str.'' |iconv -c -f utf-8 -t uhc');  
     return ereg_replace("\\\\n","\n",$str);  
}
* php iconv 이용
function tostring($text){
      return iconv('UTF-16LE', 'UHC', chr(hexdec(substr($text[1], 2, 2))).chr(hexdec(substr($text[1], 0, 2))));
}
function urlutfchr($text){
      return urldecode(preg_replace_callback('/%u([[:alnum:]]{4})/', 'tostring', $text));
}
* 그외
function eucToutf($strValue) {
return iconv("EUC-KR","UTF-8",$strValue);
}
function utfToeuc($strValue) {
return iconv("UTF-8","EUC-KR",$strValue);
}|  | 
댓글목록
등록된 댓글이 없습니다.





 자바스크립트 escape()를 php로  쓰기
  자바스크립트 escape()를 php로  쓰기

