PHP & Others

E-Mail 체크, IP 체크

페이지 정보

본문

<?
        function is_email($email)
        {
                return preg_match("/^(.+)\\@(.+)\\.(.+)$/", $email);
        }

        function is_ip($ip)
        {
                if(preg_match("/^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/", $ip, $match))
                        if($match[1] < 256 && $match[2] < 256 && $match[3] < 256 && $match[4] < 256)
                                return true;

                return false;
        }
?>

출처.. zend.com

관련자료

등록된 댓글이 없습니다.
Today's proverb
"우리가 저지르는 가장 나쁜 잘못은 남의 잘못에 대해 선입견을 갖는 것이다." (칼릴 지브란)