Confusion with preg_match for Specific DIV can anyone help me?

Can anyone tell me how to fetch all data in specific DIV and inside it is specifec Tag "

" of given url

I Tried this by changing tag names but i Failed please any php expert can me help me ?

<?php function getdata($Url){ $str = file_get_contents($Url); if(strlen($str)>0){ preg_match("/\(.*)\<\/title\>/",$str,$data); return $data[1]; } } echo getdata("http://www.w3schools.com/"); ?>

Example URL : www.productsite.com

Product Web HTML Example :

Product 1

http://www.productsite.com/simpleproducatpage1.aspx


Product 2

http://www.productsite.com/simpleproducatpage2.aspx


Product 3

http://www.productsite.com/simpleproducatpage3.aspx


Product 4

http://www.productsite.com/simpleproducatpage4.aspx


Product 5

http://www.productsite.com/simpleproducatpage5.aspx


Product 6

http://www.productsite.com/simpleproducatpage6.aspx


Product 7

http://www.productsite.com/simpleproducatpage7.aspx


and so on ...

This Output i need :

http://www.productsite.com/simpleproducatpage1.aspx
http://www.productsite.com/simpleproducatpage2.aspx
http://www.productsite.com/simpleproducatpage3.aspx
http://www.productsite.com/simpleproducatpage4.aspx
http://www.productsite.com/simpleproducatpage5.aspx
http://www.productsite.com/simpleproducatpage6.aspx
http://www.productsite.com/simpleproducatpage7.aspx
and so on …

Sponsor our Newsletter | Privacy Policy | Terms of Service