hey, I am suppose to fetch the title and url form the below link http://www.wikio.com/blogs/top/technology I did ir seperatly 1st for title and url.... below is the script for both for title:- <?php for($number=0;$number<20;$number+=20) { $titles=array(); $url="http://www.wikio.com/blogs/top/technology?start={$number}"; $html=file_get_contents($url); while(preg_match('#target="_blank"">(.*?)</a>#', $html, $matches)) { $html=str_replace($matches[0],'',$html); $titles[]=$matches[1]; } } foreach($titles as $title) { print "$title\n"; } ?> for url:- <?php for($number=0;$number<20;$number+=20) { $name=array(); $url="http://www.wikio.com/blogs/top/technology?start={$number}"; $html=file_get_contents($url); while(preg_match('#target="_blank"">(.*?)</a>#', $html, $matches)) { $html=str_replace($matches[0],'',$html); $name[]=$matches[1]; } } foreach($name as $name1) { print "$name1\n"; } ?>
nope...in the preg_match() values are diffrent....one fetches the url or web pages and another fetches the title of url........