471,066 Members | 1,195 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,066 software developers and data experts.

Split a string in to several parts

250 100+
I want to split the following string.This is the exact format.
start56.23 29-07-2008 16:10 1Stop775632145231234

2part-29-07-2008 16:10

How can i split these four part at once. Can I use explode or split to do that? or Is there any way? Could someone help me?
Aug 5 '08 #1
2 1161
13,262 8TB
Will the string always have the exact same number of characters? In which case taking substrings is probably best.
If not (as is likely) then can you describe more what each part is.
e.g First part will be a number with 2 decimal places followed by a space followed by a date followed by a space e.t.c
Aug 5 '08 #2
its according to ur need in which way ur splitting ur string ....

if ur spltting based on number of characters like 4 character string or 5 character string then use str_split() function....

if ur splitting it with some special case like space or : or , or- or_ etc.... the use
explode() function.....

but this both function work good when its used with comman separators or comman size if both of them varry's then u will not get the desired result....
Aug 6 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Roshawn | last post: by
9 posts views Thread by needin4mation | last post: by
4 posts views Thread by Michele Petrazzo | last post: by
13 posts views Thread by Chaim Krause | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.