08-05-2013, 04:44 AM | #1 |
Registered User
Join Date: Mar 2013
Posts: 246
|
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.
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
09-26-2013, 12:09 PM | #2 |
Registered User
Join Date: Sep 2013
Location: Kalamata, Greece
Posts: 53
|
try this:
$output = preg_split( "/ (-|.|,|?) /", $input ); |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Importance of Php Development for Web Development | tech.biztech | Programming General | 35 | 11-22-2019 12:37 AM |
PHP introduction | stevepatton | PHP / mySQL | 48 | 06-17-2019 02:02 AM |
PHP project training in ahmedabad, live project training in php ahmedabad | anantitsolution | Post your ad here | 1 | 07-16-2013 07:42 PM |
How do I connect a single PHP script to multiple pages? | noahwilson | PHP / mySQL | 0 | 04-22-2013 02:57 AM |
Are you aware of the fact that PHP programming is the most widely used one? | johnrichards774 | PHP / mySQL | 3 | 02-07-2012 05:41 AM |