PHP file_get_contents with php intact?

后端 未结 6 1226
后悔当初
后悔当初 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 17:14

    By using $content = file_get_contents('/path/to/your/file.php'); all the PHP tags will be preserved, you can then eval() or tokenize them to do whatever you want.

提交回复
热议问题