How to parse a string

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
kosaks
Forum Newbie
Posts: 10
Joined: Thu Aug 18, 2011 10:21 am

How to parse a string

Post by kosaks »

Hello to all..

Does anyone knows how to parse this string?
#1# "+236543765432","+447537404702","UCB","2011-12-19","15:17:35","UCB","","" "+645743657865","+447537404702","UCB","2011-12-19","15:25:42","Ucb","","" "+874597628674","+447537404702","UCB","2011-12-19","15:34:14","UCB","",""

I dont know how to parse string on PHP. Can you help me?

thanks
User avatar
spedula
Forum Commoner
Posts: 81
Joined: Mon Mar 29, 2010 5:24 pm

Re: How to parse a string

Post by spedula »

Your question is kind of vague, which bits of data are you trying to pull out exactly? And how do you want it organized?

Without knowing that info, I can still point you in a somewhat right direction...

Code: Select all

str_replace('"', '', $string);
That will remove all double quotes.

Code: Select all

explode(',', $string);
The will break the string into an array, splitting it by ',' (comma).
Post Reply