I have an xml file with something like this:
<itens>
<item>
<name>Ball</name>
<color1>Yellow</color1>
<color2>Black</color2>
<color3>Red</color3>
</item>
...
</itens>
I'm already looping it using simplexml_load_file and than a foreach. So I'm able to echo $item->color1 and get Yellow. But what I need is to loop through those colors, something like:
for($x = 1; $x < 4; $x++){
echo $item->color.$x;
}
Thanks a lot!