Good afternoon guys, I need a little help.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://pubproxy.com/api/proxy?api=...');
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);
$json = json_decode($data);
$proxy = $json->data->ipPort;
echo $proxy;
I'm not able to extract the ipport page from json. Website response:
{"data":[{"ipPort":"83.169.202.2:3128","ip":"83.169.202.2","port":"3128","country":"RU","last_checked":"2018-07-22 09:05:20","proxy_level":"anonymous","type":"http","speed":"15","support":{"https":1,"get":1,"post":1,"cookies":1,"referer":1,"user_agent":1,"google":0}}],"count":1}
I have tried these ways:
$proxy = $json->data->ipPort;
$proxy = $json->ipPort;