I've been working on a website and one of its functionalities is a budget maker, that is, a place where the user can somewhat find out what they'd be spending for their service of choice, however, googles API is paid and at the moment, for this project, it isn't viable for me to do it that way, I've been trying to use Microsoft's Bing maps API, but its all with "URLs" and JSON's and I'm kind of out of my depth, can anyone explain to me maybe what I need to do to "decode" the JSON file and get the distance parameters?
Documentation: https://learn.microsoft.com/en-us/bingmaps/rest-services/routes/calculate-a-route
My URL code: "http://dev.virtualearth.net/REST/v1/Routes?wayPoint.1=$startAdress&viaWaypoint.2=$UserInputedAdress&travelMode=Driving&optimize=distance&distanceUnit=km&key=BingMapsKey";
My code for the decoding json - print_r(json_decode($distanciaBing)); (always returns '1', nothing else no matter the inputs.