Jump to content

[SOLVED] print_r of table - how to get the actual values into variables?


Darla

Recommended Posts

Hello

 

I am kindof a newbie on this so bare with me.. I have used xml_parser to read some xml and put the values in an array using xml_parse_into_struct. This xml is stored in $results. I get the values when doing this: print_r($results); However, I'd like to get my hands on some of the simple values from the xml in neat variables so I can further put them into a db. I have tried accessing the values like this:

echo $results[0];

echo $results["boat"];

echo $results['boat'];

 

But all it returns is a simple 'A'. Great if someone could give me a tip on this.

 

Also, I am wondering what is the best way to fetch xml: xml_parse, DOM or simplexml?

 

Darla

ahh I found it - seems it was set to the variable $results later - it was supposed to be a table but turns out it was a string, when I tried the originale table name it worked :) Sorry to have bothered you and thanks for helping!!

 

Btw: what do you prefer when fetching from xml? simple_xml, dom or parse_xml?

 

Have a nice evening!  :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.