file_put_contents() not working
<p>I want to save the contents in the file in <code>order.dat</code> and <code>now</code> I'm using this PHP script:</p>

<pre><code>&lt;?php
$a_str = array( 
  "orderid"=&gt;"175", 
  "txnid"=&gt;"RC456456456", 
  "date"=&gt;"54156456465", 
  "amount"=&gt;"109$" 
); 

$file = 'order.txt';
$contents = implode(PHP_EOL, $a_str);
//$contents = $orderid.'|'.$txnid.'|'.$date.'|'.$amount;
$contents .= PHP_EOL . PHP_EOL;
file_put_contents($file, $contents);
print("|$contents|");
?&gt;
</code></pre>

<p>How it is possible to save the data in <code>order.dat</code> file in this format?</p>

<pre><code>175|RC456456456|54156456465|109$|
</code></pre>
