i was wondering if anyone could see why the array below is creating new lines in the index.php code, even though I don't put \n tags in. I've put a red ! marker where unwanted new lines pop up.
<?
$array=file("cdplayer.ini");
foreach (array_keys($array) as $i) {
if (ereg("[.{6,7}]!",$array[$i])) {print "<table border=1>\n<tr><td colspan=3><a name=$array[$i]>";} else {;}
if (ereg("EntryType=",$array[$i])) {$EntryType=$array[$i];} else {;}
if (ereg("artist=",$array[$i])) {$array[$i]=ltrim($array[$i],"artist="); print "<a href=artists.php?name=\"$array[$i]!\">$array[$i]!</a>";} else {;}
if (ereg("title=",$array[$i])) {$array[$i]=ltrim($array[$i],"title="); print "- $array[$i]!</td></tr>";} else {;}
if (ereg("numtracks=",$array[$i])) { $numtracks=$array[$i];} else {;}
if (ereg(".{1,2}=",$array[$i])) {
$track=explode("=",$array[$i]);
$track[0]=($track[0]+1);
if (ereg(".$",$track[0])) {$track[0]=sprintf("%02d",$track[0]);} else {;}
print "<tr><td>$track[0]</td><td>$track[1]!</td></tr>";
} else {;}
if (ereg("order=",$array[$i])) {print "\n</table>\n\n<br>\n\n"; $order=$array[$i];} else {;}
if (ereg("numplay=",$array[$i])) {$numplay=$array[$i];} else {;}
}
?>
So obviously a new line is being created everytime a "$array[$i]" or "$track[1]" string is entered into the index.php file - I can't see why the php code is doing that though.
This is how index.php looks when created…
<table border=1>
<tr><td colspan=3><a name=[1ABB520]
<a href=artists.php?name="ATB
">ATB
</a>- Movin' Melodies
</td></tr><tr><td>01</td><td>The First Tones
</td></tr><tr><td>02</td><td>Emotion
</td></tr><tr><td>03</td><td>Underwater World
</td></tr><tr><td>04</td><td>Zwischenstück
</td></tr><tr><td>05</td><td>9 PM (Till I Come)
</td></tr><tr><td>06</td><td>Killer 2000
</td></tr><tr><td>07</td><td>Too Much Rain (ATB versus Woody van Eyd
</td></tr><tr><td>08</td><td>Don't Stop
</td></tr><tr><td>09</td><td>Obsession
</td></tr><tr><td>10</td><td>My Dream
</td></tr><tr><td>11</td><td>Kayama
</td></tr><tr><td>12</td><td>Beach Vibes By EFF
</td></tr><tr><td>13</td><td>Movin' Melodies
</td></tr><tr><td>14</td><td>Sunburn
</td></tr><tr><td>15</td><td>9 PM (Till I Come) (Signum Remix)
</td></tr>
</table>
<br>
<tab…
…and the source data coming from cdplayer.ini looks like this…
[1ABB520]
EntryType=1
artist=ATB
title=Movin' Melodies
numtracks=15
0=The First Tones
1=Emotion
2=Underwater World
3=Zwischenstück
4=9 PM (Till I Come)
5=Killer 2000
6=Too Much Rain (ATB versus Woody van Eyd
7=Don't Stop
8=Obsession
9=My Dream
10=Kayama
11=Beach Vibes By EFF
12=Movin' Melodies
13=Sunburn
14=9 PM (Till I Come) (Signum Remix)
order=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
numplay=15
[117…
Any ideas ?