YesYo.com MintState Forums
뒤로    YesYo.com MintState BBS > Tech > PHP
검색
멤버이름    오토
비밀번호 
 

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

페이지 정보

작성자 MintState 댓글 0건 조회 14,436회 작성일 08-11-03 10:50

본문

자바스크립트 escape()를 php로  쓰기
 
* 서버를 이용하는 방법
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);
}

댓글목록

등록된 댓글이 없습니다.

Total 165건 4 페이지
PHP 목록
번호 제목 글쓴이 조회 날짜
90 MintState 14741 11-03
89 MintState 14545 11-03
88 MintState 14790 11-03
87 MintState 13737 11-03
86 MintState 24558 11-03
85 MintState 19619 11-03
84 MintState 23424 11-03
83 MintState 15732 11-03
82 MintState 18267 11-03
81 MintState 19967 11-03
80 MintState 12540 11-03
79 MintState 13574 11-03
78 MintState 14568 11-03
77 MintState 14418 11-03
76 MintState 10422 11-03
75 MintState 15164 11-03
74 MintState 13381 11-03
73 MintState 12897 11-03
열람중 MintState 14437 11-03
71 MintState 10312 11-03
70 MintState 11220 11-03
69 MintState 14381 11-03
68 MintState 14324 11-03
67 MintState 12627 11-03
66 MintState 12255 11-03
게시물 검색
모바일 버전으로 보기
CopyRight ©2004 - 2024, YesYo.com MintState. ™