title: How to replace Text in a PDF form field using PHP
body: <p>I was searching about 3 hours to find a solution to my problem. I already browsed trough the stackoverflow questions regarding my problem but could not find a solution.</p>
  
  <p>What I'm currently trying to do is to replace text in a PDF form field using PHP. The PDF file  has a textfield containing a placeholder text like [placeholder].</p>
  
  <p>What I tried to do is:</p>
  
  <pre><code>$pdf_content = file_get_contents(source_pdf.pdf);
  $put = str_replace('[placeholder]', 'NEW VALUE', $pdf_content);
  file_put_contents('temp_pdf/test.pdf', $put);
  </code></pre>
  
  <p>When I open the PDF it seems that the placeholder was not replaced. But if I klick into the textfield my "NEW VALUE" appears. If I klick out again "[placeholder]" is assigned again.</p>
  
  <p>Due to this I think this is not the right attempt for my purpose.</p>
  
  <p>My question now is: Is there a simple and effective way to implement this?
  I don't want to use FDFs but instead replace the text right in my source PDF.</p>