[PHP]
Here is a piece of code, that is close to doing what I want it to.
The end result I would like to have is an array that is simple to work with.
If the XML tag was <issue-name>RED HAT</issue-name>, I would like something
like the following:
$Tags['issue-name']. So I could print it out. Something like, print
"$Tags['issue-name']<br>\n";
I was able to get a numerical representation of the array like, $Tags[5] and
the value of that tag was "RED HAT", but then I would have to know what the
position of the data I am looking for in the array. I would prefer to know
the tag name and the array and get to the data that way. I know there is a
way to do this, but I just can't figure it out. There is a lot of
information on Parsing the XML file but not getting into a useful array, or
at least that I have found easily to understand.
if(!isset($Sym)) { $Sym = 'IKN'; }
$URI = 'http://quotes.nasdaq.com/quote.dll?page=xml&mode=stock&symbol=';
$simple = implode( '', file("$URI$Sym"));
$p = xml_parser_create();
xml_parse_into_struct($p,$simple,$vals,$index);
xml_parser_free($p);
//echo "Index array\n";
//print_r($index);
//echo "\nVals array\n";
//print_r($vals);
Christopher J. Crane
Network Operations Manager
IKON Office Solutions
860.659.6464