title: Replace line in text file using PHP
body: <p>I have a text file with the following data:</p>
  
  <pre><code>1_fjd
  2_skd
  3_fks
  </code></pre>
  
  <p>I want to replace a part in my text file using php. For example I want to do this:</p>
  
  <p>Find the line that starts with "<code>2_</code>" and replace it with "<code>2_word</code>", so everything after '2_' is being replaced by:'word'. How can I do this in php?</p>