{"id":19,"date":"2008-05-14T16:48:28","date_gmt":"2008-05-14T09:48:28","guid":{"rendered":"http:\/\/www.icez.net\/blog\/?p=19"},"modified":"2008-05-14T16:58:47","modified_gmt":"2008-05-14T09:58:47","slug":"php-email-validation","status":"publish","type":"post","link":"https:\/\/www.icez.net\/blog\/19\/php-email-validation","title":{"rendered":"0015 | PHP Email Validation"},"content":{"rendered":"<p>\u0e1a\u0e17\u0e04\u0e27\u0e32\u0e21\u0e19\u0e35\u0e49\u0e2d\u0e49\u0e32\u0e07\u0e2d\u0e34\u0e07 + \u0e04\u0e31\u0e14\u0e25\u0e2d\u0e01\u0e21\u0e32\u0e08\u0e32\u0e01\u0e40\u0e27\u0e47\u0e1a\u0e44\u0e0b\u0e15\u0e4c\u0e15\u0e48\u0e2d\u0e44\u0e1b\u0e19\u0e35\u0e49<br \/>\nSpoono.com &#8211; <a href=\"http:\/\/www.spoono.com\/php\/tutorials\/tutorial.php?id=41\" target=\"_blank\">Spoono &#8211; PHP Tutorials &#8211; Email Validation<\/a><\/p>\n<p>\u0e41\u0e1a\u0e1a\u0e27\u0e48\u0e32\u0e01\u0e33\u0e25\u0e31\u0e07\u0e2b\u0e32\u0e15\u0e31\u0e27 validate email \u0e40\u0e1e\u0e25\u0e34\u0e19\u0e46 \u0e44\u0e1b\u0e40\u0e08\u0e2d\u0e15\u0e31\u0e27\u0e19\u0e35\u0e49\u0e21\u0e32 \u0e16\u0e39\u0e01\u0e43\u0e08\u0e04\u0e23\u0e31\u0e1a (\u0e2e\u0e32\u0e46)<br \/>\n\u0e40\u0e2d\u0e32\u0e21\u0e32\u0e25\u0e07 \u0e40\u0e1c\u0e37\u0e48\u0e2d\u0e40\u0e01\u0e47\u0e1a\u0e44\u0e27\u0e49\u0e43\u0e0a\u0e49\u0e2d\u0e35\u0e01<\/p>\n<blockquote><p><span style=\"color: #0000ff;\">function <\/span><span style=\"color: #993300;\">checkEmail<\/span>(<span style=\"color: #008080;\">$email<\/span>) {<br \/>\n<span style=\"color: #0000ff;\">if<\/span> (<span style=\"color: #ff0000;\">eregi<\/span>(<span style=\"color: #ff00ff;\">&#8220;^[a-zA-Z0-9_]+@[a-zA-Z0-9\\-]+\\.[a-zA-Z0-9\\-\\.]+$]&#8221;<\/span>, <span style=\"color: #008080;\">$email<\/span>)) {<br \/>\n<span style=\"color: #0000ff;\">return false<\/span>;<br \/>\n}<\/p>\n<p><span style=\"color: #0000ff;\">list<\/span>(<span style=\"color: #008080;\">$Username<\/span>, <span style=\"color: #008080;\">$Domain<\/span>) = <span style=\"color: #ff0000;\">split<\/span>(<span style=\"color: #ff00ff;\">&#8220;@&#8221;<\/span>,<span style=\"color: #008080;\">$email<\/span>);<\/p>\n<p><span style=\"color: #0000ff;\">if <\/span>(<span style=\"color: #ff0000;\">getmxrr<\/span>(<span style=\"color: #008080;\">$Domain<\/span>, <span style=\"color: #008080;\">$MXHost<\/span>)) {<br \/>\n<span style=\"color: #0000ff;\">return true;<\/span><br \/>\n} <span style=\"color: #0000ff;\">else <\/span>{<br \/>\n<span style=\"color: #0000ff;\">if <\/span>(<span style=\"color: #ff0000;\">fsockopen<\/span>(<span style=\"color: #008080;\">$Domain<\/span>, <span style=\"color: #993300;\">25<\/span>, <span style=\"color: #008080;\">$errno<\/span>, <span style=\"color: #008080;\">$errstr<\/span>, <span style=\"color: #993300;\">7<\/span>)) {<br \/>\n<span style=\"color: #0000ff;\">return true<\/span>;<br \/>\n} <span style=\"color: #0000ff;\">else <\/span>{<br \/>\n<span style=\"color: #0000ff;\">return false<\/span>;<br \/>\n}<br \/>\n}<br \/>\n}<\/p><\/blockquote>\n<p>\u0e1b\u0e25. \u0e17\u0e33 syntax highlight \u0e41\u0e1a\u0e1a\u0e2d\u0e31\u0e15\u0e42\u0e19\u0e21\u0e37\u0e2d\u0e19\u0e35\u0e48\u0e40\u0e2b\u0e19\u0e37\u0e48\u0e2d\u0e22\u0e19\u0e30\u0e40\u0e19\u0e35\u0e48\u0e22<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0e1a\u0e17\u0e04\u0e27\u0e32\u0e21\u0e19\u0e35\u0e49\u0e2d\u0e49\u0e32\u0e07\u0e2d\u0e34\u0e07 + \u0e04\u0e31\u0e14\u0e25\u0e2d\u0e01\u0e21\u0e32\u0e08\u0e32\u0e01\u0e40\u0e27\u0e47\u0e1a\u0e44\u0e0b\u0e15\u0e4c\u0e15\u0e48\u0e2d\u0e44\u0e1b\u0e19\u0e35\u0e49 Spoono.com &#8211; Spoono &#8211; PHP Tutorials &#8211; Email Validation \u0e41\u0e1a\u0e1a\u0e27\u0e48\u0e32\u0e01\u0e33\u0e25\u0e31\u0e07\u0e2b\u0e32\u0e15\u0e31\u0e27 validate email \u0e40\u0e1e\u0e25\u0e34\u0e19\u0e46 \u0e44\u0e1b\u0e40\u0e08\u0e2d\u0e15\u0e31\u0e27\u0e19\u0e35\u0e49\u0e21\u0e32 \u0e16\u0e39\u0e01\u0e43\u0e08\u0e04\u0e23\u0e31\u0e1a (\u0e2e\u0e32\u0e46) \u0e40\u0e2d\u0e32\u0e21\u0e32\u0e25\u0e07 \u0e40\u0e1c\u0e37\u0e48\u0e2d\u0e40\u0e01\u0e47\u0e1a\u0e44\u0e27\u0e49\u0e43\u0e0a\u0e49\u0e2d\u0e35\u0e01 function checkEmail($email) { if (eregi(&#8220;^[a-zA-Z0-9_]+@[a-zA-Z0-9\\-]+\\.[a-zA-Z0-9\\-\\.]+$]&#8221;, $email)) { return false; } list($Username, $Domain) = split(&#8220;@&#8221;,$email); if (getmxrr($Domain, $MXHost)) { return true; } else { if (fsockopen($Domain, 25, $errno, $errstr, 7)) { return true; } else [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[30,31,32],"class_list":["post-19","post","type-post","status-publish","format-standard","hentry","category-php","tag-email","tag-php-coding","tag-validation"],"_links":{"self":[{"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/posts\/19","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/comments?post=19"}],"version-history":[{"count":0,"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/posts\/19\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/media?parent=19"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/categories?post=19"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/tags?post=19"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}