Read a .php file using php

后端 未结 3 1780
暗喜
暗喜 2021-01-14 18:01

How to read a .php file using php

3条回答
  •  既然无缘
    2021-01-14 18:53

    If you want to get the content generated by PHP, then

    $data = file_get_contents('http://host/path/file.php');
    

    If you want to get the source code of the PHP file, then

    $data = file_get_contents('path/file.php');
    

    Remember that file_get_contents() will not work if your server has *allow_url_fopen* turned off.

提交回复
热议问题