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

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

페이지 정보

작성자 MintState 댓글 0건 조회 14,457회 작성일 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 15744 11-03
114 MintState 15539 11-03
113 MintState 15404 02-17
112 MintState 15346 04-17
111 MintState 15341 07-28
110 MintState 15240 11-03
109 MintState 15178 11-03
108 MintState 15075 11-03
107 MintState 15069 10-31
106 MintState 14915 04-17
105 MintState 14902 10-29
104 MintState 14870 10-29
103 MintState 14807 10-29
102 MintState 14802 11-03
101 MintState 14754 11-03
100 MintState 14673 11-10
99 MintState 14582 10-31
98 MintState 14581 11-03
97 MintState 14567 11-10
96 MintState 14566 03-14
95 MintState 14563 11-03
94 MintState 14543 11-10
93 MintState 14519 11-10
92 MintState 14499 10-28
열람중 MintState 14458 11-03
게시물 검색
모바일 버전으로 보기
CopyRight ©2004 - 2024, YesYo.com MintState. ™