I previously used to use wget -r
on the linux terminal for downloading files with certain extensions:
wget -r -A Ext URL
But now I was assigned by my lecturer to do the same thing using PHP or Python. Who can help?
I previously used to use wget -r
on the linux terminal for downloading files with certain extensions:
wget -r -A Ext URL
But now I was assigned by my lecturer to do the same thing using PHP or Python. Who can help?
You can use PHP function file_get_contents()
to retrieve the contents of a documents. The first argument of the function is filename which can either be a local path to a file or a URL.
See example from PHP docs
<?php
$homepage = file_get_contents('http://www.example.com/');
echo $homepage;
?>