title: How to make file .json with codeigniter?
body: <p>This is my json encode in my controller:</p>
  
  <pre><code>public function loaddata(){
      $sql = $this-&gt;db-&gt;query('select * from e_alat_angkutan')-&gt;result();
  
      return json_encode($sql);
  
  }
  </code></pre>
  
  <p>how to make file .json ? please help</p>