Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-16-2012, 08:11 PM   PM User | #1
earthgrid
New to the CF scene

 
Join Date: Jan 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
earthgrid is an unknown quantity at this point
Lightbulb php array help needed

Greetings. I'm working on a script to interpret XML output from a server script. I have a script that converts the XML into an array. The challenge I'm having is being able to retrieve data from the array based on how this array is created by the script. Here is an excerpt line of the output from the print_r command from $myArray which is the resulting array from the XML output.

Array ( [XMLOutput] => Array ( [0] => Array ( [suggestion] => Array ( [@attributes] => Array ( [data] => my result here ) ) ) [1] => Array ( [suggestion] => Array ( [@attributes] => ... etc - continues this way for all records followed by )))))

I was having trouble with the syntax but figured it out. For your reference if any of you have this same issue here's the answer:
PHP Code:
$myresult =  $searchResult['XMLOutput'][0]['suggestion']['@attributes']['data']; 

Last edited by earthgrid; 01-16-2012 at 09:33 PM.. Reason: figured it out...
earthgrid is offline   Reply With Quote
Reply

Bookmarks

Tags
array, php

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:49 PM.


Advertisement
Log in to turn off these ads.