Read and output a json object with the least server processing expenditure possible
The code can be slightly improved, but it won't make much of a difference overall. This whole approach seems a bit weird. Why does the JSON file exist in the first place?

Here is the 'improved' version:

&lt;?php

// read the json file on the server
$txt = file_get_contents("json");

// get the id of the application
$id = filter_input(INPUT_GET, "id", FILTER_SANITIZE_STRING); 
if (isset($id)) {
    // decode json
    $json = json_decode($txt, true);
    // remove all other ids from the list
    $appInfo = $json["ids"][$id];
    unset($json["ids"]);
    $json["ids"][$id] = $appInfo;
    // encode and return json
    echo json_encode($json);
}
else {
  // simply echo the content
  echo $txt;
}


I sanatized the input by using filter_input(). That's not really needed, but always a good idea. I also simplified the code a bit more. 

This is only a tiny piece of code, so there's not much I can do. I have a feeling that more could be achieved if we knew why you do this in the first place. What is this JSON used for?

=============================================

I couldn't resist proposing the code below for the "filechanger".

&lt;?php

// read the json file on the server
$txt = file_get_contents("json");
// decode json
$json = json_decode($txt, true);
// get all application information
$appInfos = $json["ids"];
// write the to separate files
foreach ($appInfos as $appId =&gt; $appInfo) {
    // set application info
    unset($json["ids"]);
    $json["ids"][$appId] = $appInfo;
    // create file name
    $filename = str_replace(" ", "_", $appId) . ".json";
    // encode and save json
    file_put_contents($filename, json_encode($json));
}