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

관련자료

댓글 0
등록된 댓글이 없습니다.
Today's proverb
다른 누군가의 길을 밝혀 주기 위해 등불을 켜면 결국 자신의 길도 밝히는 것이 된다. (벤 스위트랜드)