how to get file contents of locked file in PHP
<p>What's the best way, idiomatically, of getting the file contents (into a string) of a <code>flock</code>'d file in PHP?</p>

<p>Edit: To be clear, this is something locked by the current page/process. Something like:</p>

<pre><code>if(flock($fp ...)) {
  $str = READFILECONTENTS($fp);
  flock(...);
}
</code></pre>
