PHP include file multiple times in one page

前端 未结 1 1526
我在风中等你
我在风中等你 2020-12-10 19:09

I have a php-file called kal_test.php which gives a value to the variable $vbl. This variable is needed in the file called kal_generator.php<

1条回答
  •  伪装坚强ぢ
    2020-12-10 19:15

    You're likely defining a function or class in kal_generator.php. PHP aborts when you try to redefine such a function or class. Consider putting your code in a function, include that function once and then run the function instead of including a file.

    kal_test.php

    
    

    kal_generator.php

    
      blablabla
    
    EOF;
        foreach ($output as $v1) {
            echo "";
            foreach ($v1 as $v2) {
                echo "$v2";
            }
            echo "\n";
        }
    
        echo "\n";
    }
    ?>
    

    0 讨论(0)
提交回复
热议问题