Parsing JSON file with PHP

To iterator over a multidimensional array, you can use the RecursiveArrayIterator

$jsonIterator = new RecursiveIteratorIterator(
new RecursiveArrayIterator(json_decode($json, TRUE)),
RecursiveIteratorIterator::SELF_FIRST);

foreach ($jsonIterator as $key => $val) {
if(is_array($val)) {
echo "$key:n";
} else {
echo "$key => $valn";
}
}

Ajax call to remote server

you need o use a method that is called as JSONP

one of the best ways is to use jQuery to reduce the code and worries between your page and the server, and all you need to do is:

$.ajax({
  dataType: 'jsonp',
  data: 'id=10',
  jsonp: 'jsonp_callback',
  url: 'http://myotherserver.com/getdata',
  success: function () {
    // do stuff
  },
});