php - Can I parse the directory listing of an external webpage? -
is possible parse directory listing of webpage external given webpage accessible , shows list of files when access it. want know possible parse files dynamically in php , how? -thank you
sorry being not clear. mean directory listing such as: http://www.ibiblio.org/pub/ (index of /..) , ability read content array or easy manipulate in script
you can use preg_match
or domdocument
for case:
$contents = file_get_contents("http://www.ibiblio.org/pub/"); preg_match_all("|href=[\"'](.*?)[\"']|", $contents, $hrefs); var_dump($hrefs);
if want take @ working demo.
Comments
Post a Comment