Prosze o pomoc.Nie wiem jak zrobic aby jak funkcja chekEmail wskazała true to po wciśnieciu przycisku "SPRWADZ POPRAWONOSC EMAILA" wyswietliło mi zmienna $a i tak samo (false => $b)
<?php
$a = "email jest prawidłowy";
$b = "email jest nie prawidlowy";
$email = "xxx.xxx@onet.eu";
function checkEmail($email)
{
if( !preg_match( "/^([a-zA-Z0-9])+([a-zA-Z0-9._-])*@([a-zA-Z0-9_-])+
([a-zA-Z0-9._-]+)+$/", $email))
{
return false;
} else {
return true;
}
}
var_dump(function checkEmail);
?>
<html>
<br/>
<form action="" method="get">
EMAIL: <input type="text" name="email" /><br/><br/>
<input type="submit" name="submit" value="SPRWADZ POPRAWONOSC EMAILA" />
</html>
Z góry dziekuje za pomoc