title: PHP echo data to .json file
body: <p>I have a question. I have a php code that echoes data to json objects. 
  This is my code:</p>
  
  <pre><code>&lt;?php
  
  $host = "localhost"; //Your database host server
  $db = "..."; //Your database name
  $user = "..."; //Your database user
  $pass = "..."; //Your password
  
  $connection = mysql_connect($host, $user, $pass);
  
  //Check to see if we can connect to the server
  if(!$connection)
  {
      die("Database server connection failed.");  
  }
  else
  {
      //Attempt to select the database
      $dbconnect = mysql_select_db($db, $connection);
  
      //Check to see if we could select the database
      if(!$dbconnect)
      {
          die("Unable to connect to the specified database!");
      }
      else
      {
          $query = "SELECT * FROM wedstrijden";
          $resultset = mysql_query($query, $connection);
  
          $records = array();
                      $response = array(); //extra            
  
          //Loop through all our records and add them to our array
          while($r = mysql_fetch_assoc($resultset))
          {
              $records[] = $r;        
          }
  
          //Output the data as JSON
          echo json_encode($records);    
  
      }
  } 
  ?&gt;
  </code></pre>
  
  <p>The result of this is a .php file wich echoes JSON objects. But i want a .json file (like a results.json file) which shows the JSON objects. Is this possible?</p>
  
  <p>Can you help me?</p>
  
  <p>Thanks in advance.</p>