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

Software Developer in php (3 - 5 years , 2.00 - 12.00 Lacs) interview question Neosoft Technologies

Laravel 5 Eloquent Explained in the Simplest Way Facades in Laravel. Why and How? How to Register & Use Laravel Service Providers ...