<?php
function setEmail($stringMail)
{
$dataEmail = explode(',', $nstringMail); if (!empty($dataEmail)) { foreach ($dataEmail as $stringValue) {
if (filter_var($stringValue, FILTER_VALIDATE_EMAIL
)) { $emails[] = $stringValue;
}
}
}
return $emails;
}
$saida = setEmail('exemplo1@email.com; exemplo2@email.com; exemplo3@email.com; exemplo4@email.com; exemplo5@email.com; exemplo6@email.com;');
//echo "<pre>";
PD9waHAKCmZ1bmN0aW9uIHNldEVtYWlsKCRzdHJpbmdNYWlsKQogICAgewogICAgICAgICRuc3RyaW5nTWFpbCA9IHByZWdfcmVwbGFjZSgnL1w7LycsJywnLCAkc3RyaW5nTWFpbCk7CiAgICAgICAgJG5zdHJpbmdNYWlsID0gcHJlZ19yZXBsYWNlKCcvXHYrLycsJywnLCAkbnN0cmluZ01haWwpOwogICAgICAgICRuc3RyaW5nTWFpbCA9IHByZWdfcmVwbGFjZSgnL1x0Ky8nLCcsJywgICRuc3RyaW5nTWFpbCk7CiAgICAgICAgJG5zdHJpbmdNYWlsID0gcHJlZ19yZXBsYWNlKCcvXG4rLycsJywnLCAkbnN0cmluZ01haWwpOwogICAgICAgICRuc3RyaW5nTWFpbCA9IHByZWdfcmVwbGFjZSgnL1wsXCwvJywnLCcsICRuc3RyaW5nTWFpbCk7CiAgICAgICAgJG5zdHJpbmdNYWlsID0gcHJlZ19yZXBsYWNlKCcvXHMrLycsJycsICRuc3RyaW5nTWFpbCk7CiAgICAgICAgCiAgICAgICAgICAgICRkYXRhRW1haWwgPSBleHBsb2RlKCcsJywgJG5zdHJpbmdNYWlsKTsKICAgICAgICAgICBpZiAoIWVtcHR5KCRkYXRhRW1haWwpKSB7CiAgICAgICAgICAgICAgIGZvcmVhY2ggKCRkYXRhRW1haWwgYXMgJHN0cmluZ1ZhbHVlKSB7CiAgICAgICAgICAgICAgIAkgIGlmIChmaWx0ZXJfdmFyKCRzdHJpbmdWYWx1ZSwgRklMVEVSX1ZBTElEQVRFX0VNQUlMKSkgewogICAgICAgICAg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