Skip to content Skip to sidebar Skip to footer

Problem When Using Echo'd ++$value In Javascript As Part Of A Html5 Audio Player Page

I have been making myself a 'soundboard' that populates a custom HTML5 audio player for each mp3 file it finds in a directory. Now that side of it is all working exactly as I expec

Solution 1:

Rather than keep a separate count to link the the item, you can use the foreach loop to give you the item index...

So when you do

foreach ($filesas$file) {

you can use

foreach ($filesas$id => $file) { 

and then use

echo$id;

inside the loop to output the corresponding ID.

Post a Comment for "Problem When Using Echo'd ++$value In Javascript As Part Of A Html5 Audio Player Page"