Unable to use file_get_contents(), returns nothing
php
Solution
I managed to get the contents using `curl` like this:
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, "https://ninjacourses.com/explore/4/");
$result = curl_exec($ch);
curl_close($ch);
Problem
I'm trying to get some data from a website that is not mine, using this code. ``` <? $text = file_get_contents("https://ninjacourses.com/explore/4/"); echo $text; ?> ``` However, nothing is being echo'd, and the string length is 0. I've done this method before, and it has worked no problem, but with this website, it is not working at all. Thanks!