title: Inject JavaScript using PHP
body: <p>I would like to load external webpage using PHP and to inject some JavaScript to it before displaying it.</p>
  
  <p>To be honest, I have no idea at all how to do it (if it is possible). Somebody?</p>
  
  <p>Example:</p>
  
  <pre><code>$html = file_get_contents($url);
  // inject javascript here
  echo $html;
  </code></pre>