title: How to add text to file at fixed position php?
body: <p>I have this code:</p>
  
  <pre><code>$new_news = '; array(
      \'img\' =&gt;'.$path.',
      \'title\' =&gt; '.$_POST["title"].',
      \'text\' =&gt; '.$_POST["text"].'
  )';
  </code></pre>
  
  <p>and I need to add this to existing array in db.php. for example:</p>
  
  <pre><code>$news = array(
      array(
      'img' =&gt; 'images/egle.jpg', 
      'title' =&gt; 'Egle pārtraukusi ',
      'text' =&gt; 'Valsts prezidenta Andra '));
  </code></pre>
  
  <p>How can I add $new_news in length-4 using fopen()?</p>