leke Posted April 8, 2011 Share Posted April 8, 2011 Hi, Is there a way to supply multiple arguments to explode()? I tried: $form_submission = "asdf. ,asdf!? asdf"; $splitSubmission = explode((" ", ".", ",", "!", "?") $form_submission); ...but get a parse error. Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/233147-supplying-multiple-agrs-to-explode/ Share on other sites More sharing options...
Pikachu2000 Posted April 8, 2011 Share Posted April 8, 2011 explode Link to comment https://forums.phpfreaks.com/topic/233147-supplying-multiple-agrs-to-explode/#findComment-1199028 Share on other sites More sharing options...
dcro2 Posted April 8, 2011 Share Posted April 8, 2011 Basically, no you can't. But you could first replace all of those with a specific character, like '#'. Then explode by that. $characters = array(" ", ".", ",", "!", "?"); $splitSubmission = str_replace($characters, "#", $form_submission); $splitSubmission = explode("#", $splitSubmission); Link to comment https://forums.phpfreaks.com/topic/233147-supplying-multiple-agrs-to-explode/#findComment-1199030 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.