By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,943 Members | 1,890 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,943 IT Pros & Developers. It's quick & easy.

split()

P: n/a
My problem has a simple solution. However I just can't find it. I cannot
remember which 'split()' type function allows you to keep the delimiter in
place within the final array.
I've tried searching the documentation without success.
TIA
Vince
May 21 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On May 21, 3:50 pm, "Vince Morgan" <vinharAtHereoptusnet.com.au>
wrote:
My problem has a simple solution. However I just can't find it. I cannot
remember which 'split()' type function allows you to keep the delimiter in
place within the final array.
preg_match_all('~.*[delimiters]~U', $text, $matches)

or something like that.

May 21 '07 #2

P: n/a
On 21.05.2007 15:50 Vince Morgan wrote:
My problem has a simple solution. However I just can't find it. I cannot
remember which 'split()' type function allows you to keep the delimiter in
place within the final array.
I've tried searching the documentation without success.
TIA
Vince

preg_split with PREG_SPLIT_DELIM_CAPTURE or
preg_match('/[^,;]+|[,;]/'...) where ',;' are delimiters

--
gosha bine

extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok
May 21 '07 #3

P: n/a
"gosha bine" <st********@gmail.comwrote in message
news:46**********************@read.cnntp.org...
On 21.05.2007 15:50 Vince Morgan wrote:
My problem has a simple solution. However I just can't find it. I
cannot
remember which 'split()' type function allows you to keep the delimiter
in
place within the final array.
I've tried searching the documentation without success.
TIA
Vince

preg_split with PREG_SPLIT_DELIM_CAPTURE or
preg_match('/[^,;]+|[,;]/'...) where ',;' are delimiters

--
gosha bine

extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok
Yep, that's it. Thanks Gosha.
Regards,
Vince
May 21 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.