Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
email validator
SUBMITTED BY:
Guest
DATE:
June 11, 2013, 9:25 p.m.
FORMAT:
PHP
SIZE:
618 Bytes
Raw
Download
Tweet
HITS:
1225
Go to comments
Report
<?php
$email
=
"email.com"
;
$email
=
preg_match
(
"/[a-zA-Z@_-]/"
,
$email
);
try
{
if
(
!
$email
)
{
throw
new
Exception
(
"Email is not valid!"
);
}
else
{
return
1
;
}
}
catch
(
exception
$e
)
{
echo
"Error Message: <font color='red'>"
.
$e
->
getMessage
()
.
"</font><br />"
;
echo
"The error is on line: <font color='red'>"
.
$e
->
getLine
()
.
"</font><br />"
;
echo
"The file the error is in: <font color='red'>"
.
$e
->
getFile
()
.
"</font><br />"
;
}
?>
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus