title: how to put array data into text file using php
body: <p>if i use the following code i got data in text file</p>
  
  <pre><code>{"title":"sankas","description":"sakars","code":"sanrs"}    
  {"title":"test","description":"test","code":"test"}
  </code></pre>
  
  <p>but my code is working on  </p>
  
  <pre><code>{"title":"sankas","description":"sakars","code":"sanrs"}
  </code></pre>
  
  <p>so i could not add more rows.where i want to change to get correct results. </p>
  
  <pre><code>        $info = array();
      $folder_name = $this-&gt;input-&gt;post('folder_name');
      $info['title'] = $this-&gt;input-&gt;post('title');
      $info['description'] = $this-&gt;input-&gt;post('description');
      $info['code'] = $this-&gt;input-&gt;post('code');
      $json = json_encode($info);
      $file = "./videos/overlay.txt";
      $fd = fopen($file, "a"); // a for append, append text to file
  
      fwrite($fd, $json);
      fclose($fd); 
  </code></pre>