1. Go to this page and download the library: Download mmucklo/email-parse library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
/**
* function parse($emails, $multiple = true, $encoding = 'UTF-8')
* @param string $emails List of Email addresses separated by comma or space if multiple
* @param bool $multiple (optional, default: true) Whether to parse for multiple email addresses or not
* @param string $encoding (optional, default: 'UTF-8')The encoding if not 'UTF-8'
* @return: see below: */
if ($multiple):
array('success' => boolean, // whether totally successful or not
'reason' => string, // if unsuccessful, the reason why
'email_addresses' =>
array('address' => string, // the full address (not including comments)
'original_address' => string, // the full address including comments
'simple_address' => string, // simply local_part@domain_part (e.g. [email protected])
'name' => string, // the name on the email if given (e.g.: John Q. Public), including any quotes
'name_parsed' => string, // the name on the email if given (e.g.: John Q. Public), excluding any quotes
'local_part' => string, // the local part (before the '@' sign - e.g. johnpublic)
'local_part_parsed' => string, // the local part (before the '@' sign - e.g. johnpublic), excluding any quotes
'domain' => string, // the domain after the '@' if given
'ip' => string, // the IP after the '@' if given
'domain_part' => string, // either domain or IP depending on what given
'invalid' => boolean, // if the email is valid or not
'invalid_reason' => string), // if the email is invalid, the reason why
array( .... ) // the next email address matched
)
else:
array('address' => string, // the full address including comments
'name' => string, // the name on the email if given (e.g.: John Q. Public)
'local_part' => string, // the local part (before the '@' sign - e.g. johnpublic)
'domain' => string, // the domain after the '@' if given
'ip' => string, // the IP after the '@' if given
'invalid' => boolean, // if the email is valid or not
'invalid_reason' => string) // if the email is invalid, the reason why
endif;