Jump to content

How to explode multiple characters?


galvin

Recommended Posts

I have a textarea in a form where I input multiple email addresses and I separate them by a comma and then I use the following code to send an email to all of the addresses...

if(!empty($_POST['sendemails'])){

$_emails=explode(",",$_POST['sendemails']);

foreach($_emails as $v){     

$bcc .=	$v . ', '; // note the comma

}

 

Works fine, but I want to be able to separate them by comma OR semicolon OR a space/return.  How can I alter the code to look for any of those three, rather than just looking for a comma?

 

Link to comment
https://forums.phpfreaks.com/topic/191935-how-to-explode-multiple-characters/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.