bradgrafelman helped me out with a function to extract image names from html code and it is working perfectly to date
$pattern = '/<img.*src\s*=\s*["\'](.*)["\'].*>/Usi';
preg_match_all($pattern, $data, $matches);
$files = array_map('basename', $matches[1]);
now i need more help in extracting .pdf documents from html code. i have come up with
$pattern = '/<a href="\'["\'].>/Usi';
and it works ok, but cant workout how to specify only .pdf documents.
what i also want to do is combine the wtwo functions above so that i can extract images and .pdf files in one go, is this possible? if so can someone show me how its done? im stuck.