I'm sorry for asking similar question again, but I wanted to make my question short and because of this, your solutions doesn't work for me (I thought it will work in similar way in arrays).
I'm getting photos from xml file:
$filelocation=simplexml_load_file('http://path.com/file.xml');
foreach($filelocation->path->attributes() as $photo) {
$position[$flag1]["photos"] .= "<a id=\"carousel-selector-".$dont-know-what-to-do-here."\"><img src=\"".$photo."\"/></a>";
}
It's of course a part of the code which shows photos placed in xml file. What I need is to place unique id to all of them so it will work like:
<a id="carousel-selector-0"><img src="http://path.com/link.jpg"/></a>
<a id="carousel-selector-1"><img src="http://path.com/another-link.jpg"/></a>
...
Can you help me with that?