email-validator
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?
// de functie
function email_validator($email)
{
if (eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,4}$",$email))
{
$valid = "yes";
}
else
{
$valid = "no";
}
return $valid;
}
// je roept hem als volgt aan
$email = "[email protected]";
$check_email = email_validator($email);
if ($check_email == "yes")
{
echo "Het e-mail adres: $email is oke!<p>";
}
else
{
echo "Het e-mail adres: $email is <b>niet</b> oke!<p>";
}
?>
// de functie
function email_validator($email)
{
if (eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,4}$",$email))
{
$valid = "yes";
}
else
{
$valid = "no";
}
return $valid;
}
// je roept hem als volgt aan
$email = "[email protected]";
$check_email = email_validator($email);
if ($check_email == "yes")
{
echo "Het e-mail adres: $email is oke!<p>";
}
else
{
echo "Het e-mail adres: $email is <b>niet</b> oke!<p>";
}
?>