So currently I am doing this..
function get_info($data)
{
$json = file_get_contents("http://site.com/".$data.".json");
$output = json_decode($json, true);
return $output;
}
which is fine and returns everything like this:
array(1) { ["allocation"]=> array(20) { ["carrier_ocn"]=> string(4) "6664" ["available_on"]=> NULL ["status"]=> string(9) "allocated" ["access_type"]=> string(8) "wireless" ["ratecenter"]=> string(9) "CHARLOTTE" ["lat"]=> float(35.2270869) ["contaminations"]=> NULL ["city"]=> string(9) "CHARLOTTE" ["lng"]=> float(-80.8431267) ["current_on"]=> string(10) "2010-04-28" ["block_code"]=> NULL ["npa"]=> int(704) ["geo_precision"]=> int(4) ["nxx"]=> int(291) ["assigned_on"]=> NULL ["country"]=> string(2) "US" ["region"]=> string(2) "NC" ["ratecenter_formatted"]=> string(9) "Charlotte" ["carrier"]=> string(20) "SPRINT SPECTRUM L.P." ["effective_on"]=> NULL } }
How can I make that return only selected values like "ratecenter_formatted". I just want to get "Charlotte" from the above dump. How would I do this?
Thank you in advance!