title: Pass values to HTML elements from PHP in a different file
body: <p>I have an HTML file, and a PHP file.</p>
  
  <p>In the html file i have specific elements with ids that i want to pass values to from PHP.
  I can hardcode the whole HTML page in the php file and then use these values as i build the string but i'm looking for a smarter approach.</p>
  
  <p>i know i can load the entire HTML file using:</p>
  
  <pre><code>$doc = new DOMDocument();
  $doc-&gt;loadHTMLFile("filename.html");
  $html_string = $doc-&gt;saveHTML();
  </code></pre>
  
  <p>But how would i go about assigning the values to the appropriate elements?
  I am aware i can just look for the id's by searching the entire string and then appending those values, but i wonder if there is a different approach to this...</p>
  
  <p>P.S -
  The purpose of the whole thing is to pass the populated HTML into "wkhtmltopdf" if this helps..</p>