Page 1 of 1

Php string parse help

Posted: Fri Jan 06, 2012 10:10 am
by ddiamona
Hello to everyone

Can someone help me on how to parse this CSV string? I do not know how to parse string using PHP..

[text]#1# "4","+447980123456","+447781484145","","2009-07-08","10:38:15","hello "","" world","Orange" "5","+447980123456","+447781484146","","2009-07-08","10:38:55","hello world","Orange"[/text]

This string can contain a much bigger data. I would like the result to be

[text]Originator : +447781484145, Date : 2009-07-07, Time : 10:38:15, Message : hello world
Originator : +447781484146, Date : 2009-07-08, Time : 10:38:55, Message : hello world[/text]

Please guys if anyone of you knows how to parse this string it will be much appreciated. Im nearing my deadline for my work and this thing is keeping me from finishing it..

Thanks in advance

Re: Php string parse help

Posted: Fri Jan 06, 2012 10:33 am
by php3ch0
You could parse the data into an array. Look at http://www.php.net/manual/en/function.str-getcsv.php for more information