한글 자르기('?' 떼어내기)
완변한 문자 자르기가 아니라 뒤에 붙은 '?'를 떼어내는 방법입니다.
function CutString($str, $start, $end)
{
// 일단 문자열을 자릅니다.
$result = substr($str, $start, $end);
// 뒤에 오는 ?를 없애줍니다..
preg_match('/^([\x00-\x7e]|.{2})*/', $result, $string);
return $string[0];
}
A space we build together
Community
Explore
MintState November 3, 2008 at 10:23 AM Views 14100
한글 자르기('?' 떼어내기)
완변한 문자 자르기가 아니라 뒤에 붙은 '?'를 떼어내는 방법입니다.
function CutString($str, $start, $end)
{
// 일단 문자열을 자릅니다.
$result = substr($str, $start, $end);
// 뒤에 오는 ?를 없애줍니다..
preg_match('/^([\x00-\x7e]|.{2})*/', $result, $string);
return $string[0];
}
Be the first to comment.