Im not sure what Im doing wrong here but basically this script scrapes pages. The array has 3 urls to scrape but it doesnt work.
Could someone please show me where Im going wrong.
<?php
$req_url = array('http://www.first.com', 'http://www.second.com', 'http://www.third.com');
function get_head($a,$b,$c){ // Gets a string between 2 strings
$y = explode($b,$a);
$x = explode($c,$y[1]);
return $x[0];
}
function get_body($a,$b,$c){ // Gets a string between 2 strings
$y = explode($b,$a);
$x = explode($c,$y[1]);
return $x[0];
}
//Get head
echo get_head(file_get_contents('$req_url'), '<head>', '</head>');
//Gets body
echo get_body(file_get_contents('$req_url'), '<body>', '</body>');
?>
Thanks :)