Page 1 of 1

How to parse a string

Posted: Mon Dec 19, 2011 10:00 am
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

Re: How to parse a string

Posted: Mon Dec 19, 2011 1:51 pm
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).