Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: php array help needed
01-16-2012, 08:11 PM #1
- Join Date
- Jan 2012
- Thanked 0 Times in 0 Posts
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 (  => Array ( [suggestion] => Array ( [@attributes] => Array ( [data] => my result here ) ) )  => 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:
$myresult = $searchResult['XMLOutput']['suggestion']['@attributes']['data'];
Last edited by earthgrid; 01-16-2012 at 09:33 PM. Reason: figured it out...