Php string parse help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ddiamona
Forum Newbie
Posts: 1
Joined: Fri Jan 06, 2012 9:56 am

Php string parse help

Post 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
User avatar
php3ch0
Forum Contributor
Posts: 212
Joined: Sun Nov 13, 2005 7:35 am
Location: Folkestone, Kent, UK

Re: Php string parse help

Post 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
Post Reply