How do you define a PHP include as a string?

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

I tried:

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

But that just included the file normally

6条回答
  •  失恋的感觉
    2021-01-01 13:29

    Try file_get_contents().

    This function is similar to file(), except that file_get_contents() returns the file in a string.

提交回复
热议问题