Thank You to everyone who helped me on this! Especially Thanks to @Wrikken
I guess I finally figured it out:
when I used urlencode()
to transform the URLs into a proper form, i had the problem that spaces where converted to +
signs where they should rather be transformed into %20
.
That is - as I understand it - mainly because of the fact that urlencode()
is used for queries, so things like index.php?search=Hello+World
.
The Solution was to use rawurlencode()
instead.
So the Part of code in question now looks like this:
for ($i=0; $i<count($mp3files); $i++) {
$namerr[$i] = substr($oggfiles[$i],strlen($oggfolder),strpos($oggfiles[$i], '.')-strlen($oggfolder));
echo '{'."\n";
echo 'title:"'.$namerr[$i].'",'."\n";
echo 'mp3:"'.dirname($mp3files[$i]).'/'.rawurlencode(basename($mp3files[$i])).'",'."\n";
echo 'ogg:"'.dirname($oggfiles[$i]).'/'.rawurlencode(basename($oggfiles[$i])).'",'."\n";
echo '},'."\n";
}
Thanks for all the good comments!