add new functions
This commit is contained in:
parent
80ccd891cf
commit
d7ea5bef24
|
@ -15,11 +15,15 @@ class Tools {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param $str
|
||||
* @param $email
|
||||
* @return bool
|
||||
*/
|
||||
public function isEmail($str){
|
||||
return true;
|
||||
public static function isEmail($email){
|
||||
|
||||
if(filter_var($email,FILTER_VALIDATE_EMAIL))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -100,5 +104,15 @@ class Tools {
|
|||
|
||||
return $directory;
|
||||
}
|
||||
|
||||
static function getHostLink()
|
||||
{
|
||||
$protocol = "http";
|
||||
if(strpos(strtolower($_SERVER['SERVER_PROTOCOL']),"https"))
|
||||
{
|
||||
$protocol = "https";
|
||||
}
|
||||
return $protocol."://".$_SERVER['SERVER_NAME'];
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue