$data = "email@example.com,firstname.lastname@example.org,email@example.com"; list($email1, $email2, $email3) = explode(",", $data); echo $email1; // firstname.lastname@example.org echo $email2; // email@example.com
Pretty perfect but my problem is I don't know how many email addresses will be inserted by a user. He can input just 1/2 or even 30/40.
So the style of below won't work.
echo $email1; echo $email2;
I must use loop or something right? yes, just guide me how you will use loops to handle this kinda situation?
Again, 1)User can insert many emails and
2) I have to retrieve every email address as separate string.
Thanks in advance!