PHP file_get_contents with php intact?

后端 未结 6 1227
后悔当初
后悔当初 2021-02-15 16:30

As opposed to using an include, which executes the included php in the file...is it possible to save the contents of a php file to a variable - but with the php still intact and

6条回答
  •  盖世英雄少女心
    2021-02-15 16:48

    Write a function in the included PHP script that returns the desired output. Define a constant in the main PHP script. In the included PHP script, check for absence of said constant and echo the return value of the function if this is the case.

提交回复
热议问题