I'm working on a mp3 player for my website that is "database driven".
However I'm up against a "small" issue when i output the data for the playlist for the mp3 player.
First off i can say it's an embedded mp3 player that uses this code to add another song to
the playlist: %20%7C
Example: song1.mp3%20%7Csong2.mp3
So for adding songs i figured i would use mysql and php to add songs to the playlist using this code:
Code:
foreach ($stmt as $row)
{
$music .= "".$row['song']."%20%7C";
}
Which works with the playlist, but the problem is that it adds another song with no title or sound hence the %20%7C
at the end.
So I'm wondering if it is possible to check if it's the last output and remove %20%7C
from it so it only list the amount of songs i have in the database?