<?php
set_time_limit(0);
function baglan($feed,$coo=null,$ref=null){
$ch = curl_init();
$timeout = 0;
curl_setopt($ch,CURLOPT_URL,$feed);
curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT']);
if(!empty($coo)){
curl_setopt($ch,CURLOPT_COOKIEFILE,$coo);
curl_setopt($ch,CURLOPT_COOKIEJAR,$coo);
}
if(empty($ref)){
curl_setopt($ch,CURLOPT_REFERER,$feed);
}else{
curl_setopt($ch,CURLOPT_REFERER,$ref);
}
curl_setopt ($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
$veri= curl_exec($ch);
curl_close($ch);
return $veri;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
$site = baglan("http://www.sony.co.uk/pro/product/hc3d/pmw-10md/overview");
$title = explode('<title>',$site);
$title = explode('</title>',$title[1]);
$title = $title[0];
$desc = explode('<META NAME="description" CONTENT="',$site);
$desc = explode('"',$desc[1]);
$desc = $desc[0];
$over = explode('<div class="tab-inner-content overview cf">',$site);
$over = explode('</div>',$over[1]);
$over = $over[0];
preg_match_all('#<a href="http://sp.sony-europe.com/da/(.*?)" class="thumbnail">#si',$site,$img);
echo $title."<br>";
echo $desc."<br>";
echo $over."<br>";
for($i=0; $i<count($img[1]); $i++){
echo "http://sp.sony-europe.com/da/".$img[1][$i]."<br>";
}
?>
</body>
</html>bu örnek işini görür kolay gelsin