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
자신이 할 수 있는 모든 것을 하는 것은 인간이 되는 것이요, (나폴레옹)