У меня есть вопрос от json_decode url instagram https://www.instagram.com/username/?__a=1 return Null с php
$newwul = "http://www.instagram.com/username/?__a=1";
$xo = connect($newwul);
$xx = json_decode($xo,true);
$endcount = $xx['logging_page_id'];
$userid = $xx['graphql']['user']['id'];
var_dump($xo);//return NULL
var_dump($xx);//return NULL
они моя функция, подключите
function connect($urlx){
$cookie_file_path = "cookies/c.txt";
$agent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36";
$urlex = ($urlx);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $urlex);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'cookie:ig_cb=1; rur=PRN; mid=XV_v7gAEAAFbvgXMUd0PClkTvnla; csrftoken=fs1r3L5SxkJvrN6g2w239nhMgppQGVLc; urlgen="{\"185.56.80.156\": 43350}:1i2zL0:8TaH7yECjymjQH80LduQiFUJZE0"',
));
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, FALSE);
curl_setopt($ch, CURLOPT_REFERER, $urlex);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT ,100);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
return $req = curl_exec($ch);
curl_close($ch);
}
любое решение, пожалуйста?