Q:

PHP.  Foreach 4000 elements Array

I'm a newbie at php, however I managed to get an array with 4000 elements 1000arrays × 4elements
I need to create a ForEach loop so it 'allocates' my 'folder', 'path', 'artist', 'title' correctly 1000 times. 
<? php 
return array(
  array('folder' => 'A-Ha', 'path' => 'A-Ha/A-ha - Song1.mp3', 'artist' => 'A-Ha', 'title' => 'Song1') ,
  array('folder' => 'U-2', 'path' => 'U-2/U-2 - Song2.mp3', 'artist' => 'U-2', 'title' => 'Song2') ,
  array(' ...1000more arrays with four elements ... );
? >

<? php
$counter = 0;
echo '<a name="'.$counter. '"></a>
<li><span class="playb" rel="'.$p[$counter]['path'].'" >

<span class="folder">'.$p[$counter]['folder'].'</span>
<span class="artist">'.$p[$counter]['artist'].' -  </span>
<span class="title">'.$p[$counter]['title'].'</span>

</span></li>'; $counter++;? >

So what I want to get in the END [html]:
<a name="0"></a>
<li><span class="playb" rel="A-Ha/A-Ha - Song1.mp3">
<span class="folder">A-Ha</span>
<span class="artist">A-Ha - </span>
<span class="title">Song1</span>
</span></li>

<a name="1"></a>
<li><span class="playb" rel="U-2/U-2 - Song2.mp3">
<span class="folder">U-2</span>
<span class="artist">U-2 - </span>
<span class="title">Song2</span>
</span></li>

and 1000 songs more...
IM SO GLAD -- Ben Fortune read my question! 
Thank you to the rest of those who tried, I really appreciate it guys.  And I perfectly imagine how hard .... impossible it was to understand the first edit of the question. 
Thanks Ben and every1 else!  Peace! 

A:

Don't really have much to go on, as you haven't specified where or how you're getting your initial data.  And you haven't really explained if you want to add your data to an array, or get your data from an array. 
This will loop through so you can access the data. 
$counter = 0;
foreach($p as $value){
    echo '<a name="'.$counter++.'"></a>'. 
         '<li>'. 
             '<span class="playb" rel="'.$value['path'].'" >'.     
                 '<span class="folder">'.$value['folder'].'</span>'. 
                 '<span class="artist">'.$value['artist'].' -  </span>'. 
                 '<span class="title">'.$value['title'].'</span>'.     
             '</span>'. 
         '</li>';
}

