|
Posted by Andrew C on 10/31/06 06:46
"Andy Hassall" <andy@andyh.co.uk> wrote in message
news:q13ck2d3tc2204gdsi3db9q0bds510pmsj@4ax.com...
> On Mon, 30 Oct 2006 14:24:45 GMT, "Andrew C" <nonsense@totally.made.up>
> wrote:
>
>>I've encountered what seems to me to be something of an oddity while
>>playing
>>around with XML parsing in PHP, and I wondered if any of you might be able
>>to clear up my confusion...
>>
>>Here's a little code:
>>
>>$xmlDoc = new DOMDocument();
>>$xmlDoc->load('widget_data.xml');
>>$widgets = $xmlDoc->getElementsByTagName('widget');
>>
>>My understanding was that '$widgets' is an array of elements,
>
> Nope - it's a DOMNodeList object, that has support for PHP5 iterators, so
> you
> can use it in a foreach loop.
Thanks. That's my missing piece. I have quite a bit of experience of PHP
prior to 5, but I'm just feeling my way with some of the 5 stuff. :-)
A.
Navigation:
[Reply to this message]
|