Here's my code:
Code: Select all
function ShowProjects()
{
$fh = fopen("projects/list.txt","r");
for($i = 0; !feof($fh); $i++)
{
$listї] = fgets($fh);
}
fclose($fh);
for($j = 0; $j < $i; $j++)
{
trim($listї$j]);
print "<br>"".$listї$j].""<br>";
$infobar = "projects/".$listї$j]."/infobar.htm";
print $infobar;
if(file_exists($infobar))
{
include($infobar);
}
else
{
print "<br>Error Loading File";
}
}
}The file list.txt contains 3 strings seperated by returns:
wallpaper
mud
trivia
Wallpaper and mud still have spaces after them! Trivia, however, does not.
Here's my output:
"wallpaper "
projects/wallpaper /infobar.htm
Error Loading File
"mud "
projects/mud /infobar.htm
Error Loading File
"trivia"
projects/trivia/infobar.htm
I'm very new to PHP (since Sunday), so it's probably a very simple problem. I tried a search on the forums, but found nothing..
[edit]
Also, I'm using PHP 4.3.2 and Apache 2.0.
Thanks