URL에서 한글만 인코딩
페이지 정보
작성자 MintState 댓글 0건 조회 8,775회 작성일 17-05-29 09:15본문
URL에서 한글만 인코딩
출처 : http://codeigniter-kr.org/bbs/view/tip?idx=7910
function get_encoded_hurl($str) {
preg_match_all('/[\x{1100}-\x{11ff}\x{3130}-\x{318f}\x{ac00}-\x{d7af}]+/u', $str, $matches);
foreach($matches as $key2 => $val2) {
$cnt = count($val2);
if($cnt > 0) {
foreach($val2 as $key3 => $val3) {
$str = str_replace($val3, urlencode($val3), $str);
}
}
}
return $str;
}
출처 : http://codeigniter-kr.org/bbs/view/tip?idx=7910
|
|
댓글목록
등록된 댓글이 없습니다.





URL에서 한글만 인코딩