Hi. Hi have one page having some code like this: <html> <body> <a href="url1">tex 1</a> <a href="url2">tex 2</a> <a href="url3">tex 3</a> ... </body> </html> Code (markup): I want to print in other page the the url list in that page between the <body> </body> tags. Something like: Url list in your homepage: url1 url2 url3 ... Please help me with this. Thanks.
<?php //the page... $page = "http://en.wikipedia.org/wiki/Benchmark"; preg_match("/<body[^>]*>(.*?)<\/body>/is", file_get_contents($page), $matches); $body = $matches[1]; preg_match_all('/<(a.*) href="(.*?)"(.*)>/', $body, $matches); foreach($matches[2] as $match){ echo $match."<br>"; } ?> PHP: