基于php中的分隔符从现有数组中创建新数组

I am working at a login script in which the username is an email address and the user can have more than 1 email address with which he can login.

I am creating an array based on a MySQL select LIKE because all the email addresses of the user are on the same column having ## as delimiters.

Array (
    [0] => test@yahoo.com 
    [1] => testabc@yahoo.com##test123@yahoo.com 
    [2] => testing@yahoo.com##abcd@yahoo.com
)

I would like to obtain this array so I can then compare the user input with the exact email address:

Array ( 
    [0] => test@yahoo.com 
    [1] => testabc@yahoo.com 
    [2] => test123@yahoo.com 
    [3] => testing@yahoo.com 
    [4] => abcd@yahoo.com
)

Thank you!

<?php

$arr = array(); //your array, your values.
$arrGonnaBe = array(); 
foreach($arr as $a){

    $exp = explode("##",$a);
    if(count($exp)>1){
        foreach($exp as $e){
            array_push($arrGonnaBe,$e);
        }
    }else{
        array_push($arrGonnaBe,$exp[0]);
    }
} 
print_r($arrGonneBe);
?>