Go Back   Site Owners Forums - Webmaster Forums > Web Programming > Programming General > PHP / mySQL

Notices


Reply
 
Thread Tools Rate Thread Display Modes
Old 08-05-2013, 04:44 AM   #1
noahwilson
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.
noahwilson is offline   Reply With Quote

Old 09-26-2013, 12:09 PM   #2
jordan_rap13
Registered User
 
Join Date: Sep 2013
Location: Kalamata, Greece
Posts: 53
try this:

$output = preg_split( "/ (-|.|,|?) /", $input );
jordan_rap13 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

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


All times are GMT -7. The time now is 08:36 AM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.