小编use*_*642的帖子

PHP include_once将尾随1添加到页面

$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;
    }
}
Run Code Online (Sandbox Code Playgroud)

嗨,我正在尝试添加一些表(html文件)到一个页面,这个代码似乎工作,但它在每个表的末尾添加1,所以我得到:

Week 3
Name  Result
John …
Run Code Online (Sandbox Code Playgroud)

php include

2
推荐指数
1
解决办法
1295
查看次数

标签 统计

include ×1

php ×1