Hi, i am trying to create a few Functions that return a boolean Value. These functions are for things like Checking if the EmailAddress entered is a valid email address and if the phone number is valid etc...
I'm looking for something like
<?php
Function IsEmail($Address){
$Char = strpos($Address,"@");
$Char2 = strpos($Address,".");
If ($Char === False Or $Char2 === False Or $Address == "" Or strlen($Address)< 9 ){
IsEmail = FALSE;
}else{
IsEmail = TRUE;
}
?>
And to use it i want to be able to do
If(IsEmail("www.address.com")){
Print "Valid Email Address";
}else{
Print "Invalid Email Address";
}
But i am getting both results returned.. it is saying it is true AND false... I don't understand.
Thanks!😃