Jump to content

Counting Attributes


thejargen

Recommended Posts

Hi,

 

Im making a script which will parse a XML feed.

 

The problem is i cant work out a way to count the attributes (I believe they are called attributes), for example:

 

<STOCK Color="Black" Size="Small">In Stock</STOCK> Has 2 Attributes

 

<STOCK Color="Black" Size="Small" Animal="Dog">In Stock</STOCK> Has 3 Attributes

 

But i cant find any way to count them. I am using SimpleXML

 

Any help?

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/273142-counting-attributes/
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.