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

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

페이지 정보

작성자 MintState 댓글 0건 조회 14,488회 작성일 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건 3 페이지
PHP 목록
번호 제목 글쓴이 조회 날짜
115 MintState 12351 11-03
114 MintState 12488 11-03
113 MintState 17015 11-03
112 MintState 16197 11-03
111 MintState 15099 11-03
110 MintState 18301 11-03
109 MintState 12314 11-03
108 MintState 12009 11-03
107 MintState 14395 11-03
106 MintState 15279 11-03
105 MintState 20660 11-03
104 MintState 18707 11-03
103 MintState 12846 11-03
102 MintState 26242 11-03
101 MintState 19311 11-03
100 MintState 12292 11-03
99 MintState 12673 11-03
98 MintState 14366 11-03
97 MintState 14418 11-03
96 MintState 11266 11-03
95 MintState 10349 11-03
열람중 MintState 14489 11-03
93 MintState 12940 11-03
92 MintState 13425 11-03
91 MintState 15214 11-03
게시물 검색
모바일 버전으로 보기
CopyRight ©2004 - 2024, YesYo.com MintState. ™