PHP Класс JBZoo\Utils\Email

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
check ( string | array $emails ) : array Check if email(s) is(are) valid. You can send one or an array of emails.
checkDns ( string $email ) : boolean Check for DNS MX records of the email domain. Notice that a (temporary) DNS error will have the same result as no records were found. Code coverage ignored because this method requires DNS requests that could not be reliable.
getDomain ( string | array $emails ) : array Get domains from email addresses. The not valid email addresses will be skipped.
getDomainSorted ( array $emails ) : array Get domains from email addresses in alphabetical order.
getGravatarBuiltInDefaultImage ( ) : string
getGravatarBuiltInImages ( ) : array
getGravatarUrl ( string $email, integer $size = 32, string $defaultImage = 'identicon' ) : null | string Generates an Gravatar URL.

Приватные методы

Метод Описание
_extractDomain ( string $email ) : string
_handleEmailsInput ( string | array $emails ) : array Transforms strings in array, and remove duplicates.
_isValid ( string $email ) : boolean

Описание методов

check() публичный статический Метод

Check if email(s) is(are) valid. You can send one or an array of emails.
public static check ( string | array $emails ) : array
$emails string | array
Результат array

checkDns() публичный статический Метод

Check for DNS MX records of the email domain. Notice that a (temporary) DNS error will have the same result as no records were found. Code coverage ignored because this method requires DNS requests that could not be reliable.
public static checkDns ( string $email ) : boolean
$email string
Результат boolean

getDomain() публичный статический Метод

Get domains from email addresses. The not valid email addresses will be skipped.
public static getDomain ( string | array $emails ) : array
$emails string | array
Результат array

getDomainSorted() публичный статический Метод

Get domains from email addresses in alphabetical order.
public static getDomainSorted ( array $emails ) : array
$emails array
Результат array

getGravatarBuiltInDefaultImage() публичный статический Метод

public static getGravatarBuiltInDefaultImage ( ) : string
Результат string

getGravatarBuiltInImages() публичный статический Метод

public static getGravatarBuiltInImages ( ) : array
Результат array

getGravatarUrl() публичный статический Метод

Size of the image: * The default size is 32px, and it can be anywhere between 1px up to 2048px. * If requested any value above the allowed range, then the maximum is applied. * If requested any value bellow the minimum, then the default is applied. Default image: * It can be an URL to an image. * Or one of built in options that Gravatar has. See Email::getGravatarBuiltInImages(). * If none is defined then a built in default is used. See Email::getGravatarBuiltInDefaultImage().
public static getGravatarUrl ( string $email, integer $size = 32, string $defaultImage = 'identicon' ) : null | string
$email string
$size integer
$defaultImage string
Результат null | string