There may come a time when you would would like to capture a web pages HTML.
The following command will retrieve the pages content and store the HTML is a variable “$fil”. These PHP commands execute withing the proper PHP tags.
[codesyntax lang=”php”]
$fil = file_get_contents ( 'https://archbrooks.us/b4/2016/06/17/bcs-anaconda-date/' );
[/codesyntax]
To save the contents of ‘$fil” to a text file simply issue the following command.
[codesyntax lang=”php”]
echo file_put_contents ( "C:\\dev\\w32\\2016\\xxx.txt", $fil );
[/codesyntax]
Mr. Arch Brooks, Software Engineer, Brooks Computing Systems, LLC authored this article.