I am trying to get JSON data from url through a curl connection. When I open the link: it shows {"version": "N / A", "success": true, "status": true}. Now I want to get the contents.
So far I have used this:
$loginUrl = 'http://update.protect-website.com/index.php?plugin=firewall&action=getVersion'; $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL,$loginUrl); $result=curl_exec($ch); curl_close($ch); var_dump(json_decode($result));
However, I always get NULL, does anyone have an idea where is wrong?
source share