Jump to content

Storing XML Data in an Array


Baez

Recommended Posts

I'm completely dumbfounded by this and I have no idea what's going wrong. If anyone can help that would be great. This is the block of code.

 

$i = 0;
while ($reader->read())
{
	if ($reader->nodeType == XMLReader::TEXT)
	{
		$show[$i] = $reader->value;
	}
	$i++;
}
return $show;

 

It should grab the data from the XML sheet and store the value each time in the array. However it doesn't store anything. If I change "$show[$i] =" to "$show .=" it stores everything fine. I have no idea where I'm going wrong.

 

Thanks :)

Link to comment
https://forums.phpfreaks.com/topic/201997-storing-xml-data-in-an-array/
Share on other sites

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.