How do I use file_get_contents to get a gzip'ed page on a remote web server in php?

前端 未结 2 1145
鱼传尺愫
鱼传尺愫 2020-12-12 03:08

I\'m trying to receive a gzip\'ed version of a page through file_get_contents in php 5.2.9

I was able to do it using fopen with the following code:

          


        
2条回答
  •  难免孤独
    2020-12-12 03:22

    Have you tried this?

    $content = file_get_contents('http://example.com',false,$context);
    

提交回复
热议问题