![]() |
PHP: Explode A String With Multiple Delimiters.
We all know about the famous explode() in php, but this function only accepts one delimiter.. so if you want to split a sentence for example using hyphens (-) fullstops (.) and commas (,) and question marks (?), this might be a little bit of a problem, therefore this function will help you to split a string using multiple delimiters.
|
try this:
$output = preg_split( "/ (-|.|,|?) /", $input ); |
All times are GMT -7. The time now is 11:04 AM. |
Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.