How do I load a PHP file into a variable?

后端 未结 8 1472
清歌不尽
清歌不尽 2020-11-30 19:20

I need to load a PHP file into a variable. Like include();

I have loaded a simple HTML file like this:

$Vdata = file_get_contents(\"text         


        
8条回答
  •  借酒劲吻你
    2020-11-30 19:59

    file_get_contents() will not work if your server has allow_url_fopen turned off. Most shared web hosts have it turned off by default due to security risks. Also, in PHP6, the allow_url_fopen option will no longer exist and all functions will act as if it is permenantly set to off. So this is a very bad method to use.

    Your best option to use if you are accessing the file through http is cURL

提交回复
热议问题