// List the file as a link, so it can easily be viewed and checked echo "<a href=\"$url\" target=\"_blank\">$url</a><br />\n"; // This is used to extract all the references from src, href, url, action, and window.opens $ref=run_preg($text,"/(?:(?:src|href|url|action|window.open|popup)+\s*[=\(]+\s*[\"'`]*)([\+\w:?=@&\/#._;-]+)(?:[\s\"'`])/i"); function run_preg($text,$pattern) { // Handles the preg for the scan preg_match_all ($pattern, $text, $matches); return (is_array($matches)) ? $matches[1]:FALSE; }