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