title: Read stdin line by line - php
body: <p>I need to read stdin with php. I need to read first line > save it to the variable > print this variable > read second line > save it to same variable (rewrite old content) > print it - read third line > ... > end of inserted text.</p>
  
  <p>example of imput data:</p>
  
  <pre><code>u A
  u B
  h A &gt; B 1 :h1
  u C
  h B &gt; C 1 :h2
  u D
  </code></pre>
  
  <p>Can somebody help me?</p>