Sunday, 27 May 2018

Get only domain name from email using PHP.

public function getDomainName($business_email){
$domain_name = substr(strrchr($email, "@"), 1);
echo $domain_name;
}

public function getDomainNameMethodSecond($email){
if( filter_var( $email, FILTER_VALIDATE_EMAIL ) ) {
// split on @ and return last value of array (the domain)
$domain = array_pop(explode('@', $email));
// output domain
echo $domain;
}
}

Get only domain name from email using PHP.

public function getDomainName ( $business_email ){ $domain_name = substr ( strrchr ( $email , "@" ), 1 ); echo $...