XML sample below:
<?php $prospect = simplexml_load_file('sample.xml'); // get all song elements as an array $options = iterator_to_array($prospect->prospect, false); // output json echo $options->customer->contact->name."<br />"; echo $options->customer->contact->email."<br />"; echo $options->customer->contact->phone."<br />"; echo $options->vehicle->year."<br />"; echo $options->customer->comments."<br />"; ?>
<?xml version="1.0"?> <?adf version="1.0"?> <adf> <prospect> <requestdate>2013-11-07CST21:25:52-06:00</requestdate> <vehicle interest="buy" status="used"> <year></year> <make></make> <model></model> <vin></vin> <stock></stock> <trim></trim> </vehicle> <customer> <contact> <name part="first">Jessica</name> <name part="last">Smith</name> <email>Jsmith@live.ca</email> <phone>506-402-1215</phone> <address> <street line="1"></street> <city>Moncton</city> <regioncode>NB</regioncode> <postalcode></postalcode> <country>CA</country> </address> </contact> <comments> <![CDATA[Can't read full transcript? Visit http://www.mydomain.com/admin/viewtrans.php?ref=bedff7434c1576262a98df46b9c128ae to view it Customer is looking for a used 4 door sedan type of vehicle that will keep her within $350 for monthly payment. Amy: May I help you find what you're looking for? Visitor: Wondering about financing Amy: My name is Amy. May I please have your name so I know who I'm chatting with? Jess: Jessica Amy: Hello, Jessica. Nice to meet you! I'd be happy to help. May I know what particular vehicle are you interested in? Jess: I would like a sedan 4 door used Amy: Great. Are you trying to stay within a certain price range? Jess: I have an insurance payout of $2,750 and hoping to put that on a down payment for a car that would have a max everything included monthly payment of $350 Jess: Would there be anything like that available? Amy: Sounds good. We may have something that may work for you. I'd be glad to verify the inventory from my Internet Manager and get back to you with what we have that may interest you including the specifics so you'll have options. May I have your email address where we can forward the details to? Jess: Jsmith@live.ca Amy: I appreciate that, Jessica. May I also have a phone number just in case we have immediate questions? Jess: 506-555-1234 Amy: Thank you for the information. Before I forget, may I have the correct spelling of your last name so we can address you properly? Jess: Is it possible to have two people on one finance? Jess: Smith - its easier to type than it is to say Amy: Do you mean a co-signer for you? Jess: My common law partner and I would like to have joint ownership Jess: Saturday 12:30-2:30 I unfortunately have a very tight schedule Amy: Fantastic. Looking forward to see you at the dealership. I'll be forwarding this chat to my Manager as soon as we finish and rest assured that we'll be in touch. Would there be anything else I may help you today? Jess: Nope thank you. Amy: You're welcome. It's been nice chatting with you. If you have any further questions, please don't hesitate to chat with us again. Have a great evening, Jessica. Jess: Thank you you as well. ]]> </comments> </customer> <vendor> <id sequence="1" source="the chat"></id> <vendorname>My Dealership</vendorname> <contact> <name part="full">Internet Department</name> <email></email> <phone></phone> <address> <street line="1">1234 Somewhere Court</street> <city>Moncton</city> <regioncode>NB</regioncode> <postalcode>b2w0k3</postalcode> <country>Canada</country> </address> </contact> </vendor> <provider> <name part="full">My Chat co</name> <service>Chatting</service> </provider> <leadtype>sales</leadtype> </prospect> </adf>
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
21 Experts available now in Live!