Here’s the updated function I’ve been working on with Derek Jones. It is three times faster than the original. It is more solid too because strings like ‘email1,,,,email2’ won’t create empty array elements anymore.
For more background information, start reading from here.
function _str_to_array($email) {
if (is_array($email))
return $email;
$email = trim($email, " \r\n\t,");
return preg_split('/[\s,]+/', $email);
}
I believe this function can safely be implemented into the core. Derek Allard, could you prepend ‘[COMMITED]’ to the topic title when done so? Thanks a lot.
