PHP ini file_get_contents external url

后端 未结 7 1893
攒了一身酷
攒了一身酷 2020-11-22 15:28

I use following PHP function:

file_get_contents(\'http://example.com\');

Whenever I do this on a certain server, the result is empty. When I do

7条回答
  •  眼角桃花
    2020-11-22 15:48

    This will also give external links an absolute path without having to use php.ini

    ]*href\s*=\s*[\"'])(?!http)([^\"'>]+)([\"'>]+)#",'$1http://www.your_external_website.com/$2$3', $result);
    echo $result
    ?>
    

提交回复
热议问题