Jump to content

can't get the return value of a function


kalster

Recommended Posts

why is this code not working? its not printing out the $result which should be either 1 or 0.

 

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;
}
return true;
}

$email1 = "[email protected]";
$result = checkEmail($email1);
echo $result;

Link to comment
https://forums.phpfreaks.com/topic/267400-cant-get-the-return-value-of-a-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.