0

How to get website data using file_get_contents when my country blocked this site ?

I use this code for get data from website

$url_xxx = "https://www.example.com";
$text_all = file_get_contents($url_xxx);
$text_all =  strip_tags($text_all); // If you only need text not html structure
echo $text_all;

But my country was blocked https://www.example.com I want to know how to get website data using file_get_contents when my country blocked this site ?

  • use a proxy in an allowed country. Are you sure the country is the problem? Did you try to change the user-agent via `stream_context_create`? – Casimir et Hippolyte Dec 03 '16 at 15:59
  • yes, sure. problem is my country. – roboert fer Dec 03 '16 at 16:01
  • 1
    Plenty of restrictive counties out there. One giant one comes to mind. Anyway, this is a duplicate, check the answer [here](http://stackoverflow.com/questions/1336262/file-get-contents-behind-a-proxy#1336419) – kabanus Dec 03 '16 at 16:12

0 Answers0