Imaš vjerovantno ovo je samo helper funkcija, dodaj pa pokuašaj opet...
PHP kôd:
function curl($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
$html = curl('http://rs.kolektiva.net');
preg_match('#<div id="title">(.*?)</div>#is', $html, $matches);
$data["naslov"] = strip_tags($matches[1]);
preg_match('#<div class="split_b intro">(.*?)</div>#is', $html, $matches);
$data["opis"] = strip_tags($matches[1]);
preg_match('#/datastore/imagestore/naslovna_ponuda/(.*?)\.jpg#is', $html, $matches);
$data["slika"] = strip_tags($matches[0]);
preg_match('#lat=(.*?);#is', $html, $matches);
$data["lat"] = strip_tags($matches[1]);
preg_match('#lng=(.*?);#is', $html, $matches);
$data["lng"] = strip_tags($matches[1]);
print_r($data);