JSON Request with php

Hello ,
I’m currently getting my data using the soup client method and its working just fine , but one other method that I would like to try is through s JSON request , I’m having an issue with it , so when I type the request in browser as shown it works fine ,
user:key@flightxml.flightaware.com/json/FlightXML2/Search?query=-aboveGroundspeed+200
but when I try to do the exact same thing in php it doesn’t works , here is an example along with error :



$jsonurl=file_get_contents('user:key@flightxml.flightaware.com/json/FlightXML2/Search?query=-aboveGroundspeed+200');


I get failed to open stream: No error…
off course then I need to decode the JSON response but I get this warning once I use the file_get_contents , any thoughts please, is this the right of implementing it ?

file_get_contents() is likely interpreting your argument as a local filename to be opened. Try adding “http://” at the beginning.

But it would probably be better to use some of the curl functions in PHP, since that would give you more control over the request and better potential for error handling.