PHP emails are configured on your server, sometimes beyond what you can change in the PHP code itself-- your host may have set it up to automatically use that as the from email, in which case there isn't much you can do. I'd look at their FAQs to see if they explain a bit more. That will vary by host, and there may be some workarounds, like perhaps looking into php.ini (the configuration file for PHP), because it might be a default in that-- IF you have access to the file, and be careful because that could seriously change settings you don't want to mess with.
As for implode/explode, you're on the right track, but here's a basic example you can work from:
PHP Code:
$emails = "1@1.1, 2@2.2, 3@3.3, ...";
$emails = explode (', ',$emails); //note the space after the comma
sort($emails); //arranges alphabetically-- you can do other things, but just an example
$emails = implode(', ',$emails);
mail($emails,.....);
What you have above is a little confusing, maybe because there is no code before it.
From what I can tell, though, it looks like you are using too many layers of an array--
You are putting the $array within array($array), on your first line.
Remember that arrays are basically lists, and that you are making a list of a list, so now you have a one item array consisting of an array. That list item then has a list inside it, but you don't need to have it so embedded.
Once something is an array, it's just like a normal variable.
PHP Code:
$ar = array(1,2,3);
$ar2 = $ar; //not array($ar);
$ar==$ar2; //TRUE
So: $new_array=array($email_array);
should be: $new_array=$email_array;
Or, you may not need "new_array" at all.
Hope this helps.
Bookmarks