I am trying to get the text from the following url.
I have tried several methods but none of them worked. I am really desperate right now please help me and thanks in advance.
P.S. I have enabled allow_url_fopen in my ini.php already.
P.S. I am using XAMPP v3.3.2 and PHP v5.6.23
the following are the codes that I have tried (and failed)
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $url);
$result = curl_exec($ch);
echo file_get_contents($url, true);
Hi you have to pass header in your curl request, so server can treat its as browser request.