I have the following code:
<?php
$remoteDir = "http://www.domain.com/files/";
$html = join("", file($remoteDir));
preg_match_all("/HREF=\"([^\"]+jpg)\"/", $html, $matches);
$images = $matches[1];
foreach($images AS $aImage) {
$fullPath = $remoteDir . $aImage;
echo $fullPath . "<br />\n";
}
?>
My question is how should I modify the preg_match_all line if I want it to list files with different extension than jpg too.
For examples:
- .jpg, .gif and *.png
- all files in dir
Thanks in advance.