Why does this not work:
$emails = $_POST["emails"];
$emails = "'" . implode("','", explode(' ', $emails)) . "' ";
// The result is emails like this: 'foo@bar.com','foo@bar.com'
$to = array($emails);
How do i get the variable $emails into my array? (Learning PHP as I am sure is evident)
So it sounds like $_POST[’emails’] is a space separated list that you want to get into an array?
Just do this:
Of course you probably want to do some input validation before getting to this point.