title: How to append data to file using file_put_contents()?
body: <p>I have an  android app that sends multiple data from okhttp3 but i can't find a way to log all the data sent in php..My current log only houses the last record(Show below). My best guess is that the php file data is being overwritten until the last record..How can I log all the data sent? And yes all the data is being sent out from the android app...</p>
  
  <p>index.php</p>
  
  <pre><code>if (isset($_POST))
   {
  file_put_contents("post.log",print_r($_POST,true));
  }
  </code></pre>
  
  <p>Sample post.log </p>
  
  <pre><code> Array
  (
      [date] =&gt;  02 Aug, 12:22
      [company] =&gt; Assert Ventures
      [lattitude] =&gt; 32.8937542
      [longitude] =&gt; -108.336584
      [user_id] =&gt; Malboro
      [photo_id] =&gt; 1
  )
  </code></pre>
  
  <p>What I want</p>
  
  <pre><code>(
     [date] =&gt;  02 Aug, 12:22
     [company] =&gt; Three Ventures
     [lattitude] =&gt; 302.8937542
     [longitude] =&gt; -55.336584
     [user_id] =&gt; Malboro
     [photo_id] =&gt; 1
  ),
  (
     [date] =&gt;  02 Aug, 12:22
     [company] =&gt; Two Ventures
     [lattitude] =&gt; 153.8937542
     [longitude] =&gt; -88.336584
     [user_id] =&gt; Malboro
     [photo_id] =&gt; 1
  ),
  (
      [date] =&gt;  02 Aug, 12:22
      [company] =&gt; Assert Ventures
      [lattitude] =&gt; 32.8937542
      [longitude] =&gt; -108.336584
      [user_id] =&gt; Malboro
      [photo_id] =&gt; 1
  )
  </code></pre>