allow_url_fopen 和 file_get_contents

allow_url_fopen and file_get_contents

亲爱的用户,一天中的美好时光。我运行进入php.ini设置中禁用allow_url_fopen参数的问题。我需要使用函数"file_get_contents",但宿主不允许。粗略地说:

$token = "SomeToken";
$request = file_get_contents("https://api.vk.com/method/messages.get?out=0&offset=0&filtres=0&last_message_id=0&count=10&v=5.34&access_token=".$token."");
    echo $request;
    $result = json_decode($request);
    var_dump($result); // Outputed "NULL"

是否可以用不会导致禁用功能的东西替换整个东西?

尝试使用 Curl 函数发出请求。 如果它也不起作用,请联系您的托管支持并要求打开功能。通常他们可以提供帮助。