How do you define a PHP include as a string?

前端 未结 6 1357
我在风中等你
我在风中等你 2021-01-01 12:48

I tried:

$test = include \'test.php\';

But that just included the file normally

6条回答
  •  迷失自我
    2021-01-01 13:31

    Try something like:

    ob_start();
    include('test.php');
    $content = ob_get_clean();
    

提交回复
热议问题