$num = 39; //sets number of weeks - there are only 38 rounds so 39 is fine
$num2 = $num-1; //for adding the previous weeks table - rest of code not added yet
while($num > 0) // set to 0 so that when it reaches week 1 it stops
{
if ( file_exists('./results/week'.$num.'.html'))
{
echo '<h1>week '.$num.'</h1>';
echo (include_once('./results/week'.$num.'.html'));
$num = $num - 1;
}
else
{
$num = $num - 1;
}
}
Hi
I’m trying to add a number of tables (html files) to a page and this code seems to work, however it adds a 1 to the end of each table so I get:
Week 3
Name Result
John 4
Bob 3
1
Week 2
Name Result
Bob 6
John 1
1
etc.
Could some kind soul please tell me where this 1 is coming from? And how to get rid of it?
I’d be most grateful.
Ta Rich
Don’t
echo include_once, justinclude_once. The 1 is theechoed return value of theinclude_oncecall.