I have made the functions which reads the remote url and search for the link pattern in the read html. But I want to match the link having pdf extenstion only.
The code that I have made is as follows:
Code: Select all
//function string open_page(string url)
function open_page($page_url){
$handle = fopen($page_url, "rb");
$HTML = '';
while (!feof($handle)) {
$HTML .= fread($handle, 8192);
}
fclose($handle);
return($HTML);
}
//function array scan_pdf(string html)
function scan_links($HTML){
preg_match_all("/<a[^>]+href=\"([^\"]+)/i", $HTML, $match);
return($match);
}Thanks.
Love,
Dibyendra