read xml file and generate a json_encode format in php

MaximGtB

New Member
I have a xml file like the following.\[code\]<?xml version="1.0" encoding="UTF-8"?><response uri="/crm/private/xml/Leads/getCVRecords"><result><Leads><row no="1"><FL val="LEADID">580005000000189001</FL><FL val="SMOWNERID">580005000000052003</FL><FL val="Lead Owner"><![CDATA[Adithya Buddhavarapu]]></FL><FL val="First Name"><![CDATA[Srimanta]]></FL><FL val="Last Name"><![CDATA[Chakraborty]]></FL><FL val="Email"><![CDATA[[email protected]]]></FL><FL val="Lead Source"><![CDATA[iBanquet FB]]></FL><FL val="No of Employees"><![CDATA[0]]></FL><FL val="Annual Revenue"><![CDATA[0]]></FL><FL val="SMCREATORID">580005000000052003</FL><FL val="Created By"><![CDATA[Adithya Buddhavarapu]]></FL><FL val="MODIFIEDBY">580005000000052003</FL><FL val="Modified By"><![CDATA[Adithya Buddhavarapu]]></FL><FL val="Created Time"><![CDATA[2013-01-22 12:24:04]]></FL><FL val="Modified Time"><![CDATA[2013-01-22 12:24:04]]></FL><FL val="Email Opt Out"><![CDATA[false]]></FL><FL val="Last Activity Time"><![CDATA[2013-01-22 12:24:04]]></FL></row><row no="2"><FL val="LEADID">580005000000188001</FL><FL val="SMOWNERID">580005000000052003</FL><FL val="Lead Owner"><![CDATA[Adithya Buddhavarapu]]></FL><FL val="First Name"><![CDATA[Adithya]]></FL><FL val="Last Name"><![CDATA[Buddhavarapu]]></FL><FL val="Email"><![CDATA[[email protected]]]></FL><FL val="Lead Source"><![CDATA[iBanquet FB]]></FL><FL val="No of Employees"><![CDATA[0]]></FL><FL val="Annual Revenue"><![CDATA[0]]></FL><FL val="SMCREATORID">580005000000052003</FL><FL val="Created By"><![CDATA[Adithya Buddhavarapu]]></FL><FL val="MODIFIEDBY">580005000000052003</FL><FL val="Modified By"><![CDATA[Adithya Buddhavarapu]]></FL><FL val="Created Time"><![CDATA[2013-01-21 19:14:44]]></FL><FL val="Modified Time"><![CDATA[2013-01-21 19:14:44]]></FL><FL val="Email Opt Out"><![CDATA[false]]></FL><FL val="Last Activity Time"><![CDATA[2013-01-21 19:14:44]]></FL></row><row no="3"><FL val="LEADID">580005000000166001</FL><FL val="SMOWNERID">580005000000052003</FL><FL val="Lead Owner"><![CDATA[Adithya Buddhavarapu]]></FL><FL val="First Name"><![CDATA[Sri]]></FL><FL val="Last Name"><![CDATA[Nair]]></FL><FL val="Email"><![CDATA[[email protected]]]></FL><FL val="Lead Source"><![CDATA[iBanquet FB]]></FL><FL val="No of Employees"><![CDATA[0]]></FL><FL val="Annual Revenue"><![CDATA[0]]></FL><FL val="SMCREATORID">580005000000052003</FL><FL val="Created By"><![CDATA[Adithya Buddhavarapu]]></FL><FL val="MODIFIEDBY">580005000000052003</FL><FL val="Modified By"><![CDATA[Adithya Buddhavarapu]]></FL><FL val="Created Time"><![CDATA[2012-12-28 16:14:29]]></FL><FL val="Modified Time"><![CDATA[2012-12-28 16:14:29]]></FL><FL val="Email Opt Out"><![CDATA[false]]></FL><FL val="Last Activity Time"><![CDATA[2012-12-28 16:14:29]]></FL></row></Leads></result></response>\[/code\]Now I have to fetch all the values like LEADID, SMOWNERID, Lead Owner,....,Last Activity Time and store those in a json array. How can I do that? Please help me.Thanks.
 
Back
Top