The strstr function returns the first occurrence of a character in a string and returns the rest of the string

    
$email  = 'name@example.com';

$domain = strstr($email, '@');

echo $domain;
// prints @example.com