Excerpt
$website = 'http://stackoverflow.com/'; file_gets_contents($website)
loads the result of an HTTP request, nothing more . Thus, the call loads the source of the html page returned by the URL http://stackoverflow.com/ .
In particular, file_gets_contents() does not load the material referenced on the page that http://stackoverflow.com/ points to.
Evaluating JavaScript Code Using PHP
If you want to evaluate JavaScript inside HTML code using a PHP script , you probably want to use the V8 JavaScript engine , which needs to be compiled into your PHP binary:
Find an example of how to use the JavaScript V8 engine here .
Steap source share