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
이것이 바로 나의 생각이다. 하고 제대로 내놓고 말할 수 있는 자기 나름의 생각을 갖는 데는 10년이 걸린다. (A. 카뮈)