how to push array of values in php? [closed]

You can do the following. Hopefully it will help you.

$emails=array();
$arr=array('[email protected]','[email protected]','[email protected]');
foreach($arr as $val)
{
    $emails[]=$val;
}
print_r($emails);
print_r(json_encode($emails));

Browse More Popular Posts

Leave a Comment