<html> <head> <title>sdcsdzc</title> </head> <body> <?php $j=0; while($j<=2) { $url=array("http://www.w3schools.com/html/default.asp","http://www.w3schools.com/js/default.asp","http://www.w3schools.com/sql/default.asp"); $data=crawl_page($url[$j]); echo " <div style=' background-color: #E7EFEF;width:84%;border:1px solid #A5BEBE;'> <div style='background-color: white;border:1px solid #A5BEBE;'> $data[0] </div> </div>"; $j++; } function crawl_page($b) { $a=fopen($b,"r"); $contents=stream_get_contents($a); fclose($a); $contents=strtolower($contents); $start='<div class="example"'; $start_pos=strpos($contents,$start); $first_trim=substr($contents,$start_pos); $stop='</div>'; $stop_pos=strpos($first_trim,$stop); $second_trim=substr($first_trim,0,$stop_pos); $out['0'] = $second_trim; return $out; } ?> </body> </html>