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
우정이란 근심을 피할 수 있는 나무이다. (S. 코울리지)