Pogledajte određenu poruku
Staro 19. 05. 2011.   #10
webarto
expert
Grand Master
 
Avatar webarto
 
Datum učlanjenja: 11.04.2010
Poruke: 998
Hvala: 141
959 "Hvala" u 153 poruka
webarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished road
Default

Imaš vjerovantno ovo je samo helper funkcija, dodaj pa pokuašaj opet...

PHP kôd:
function curl($url){
        
$ch curl_init();
        
curl_setopt($chCURLOPT_URL$url);
        
curl_setopt($chCURLOPT_ENCODING"gzip");
        
curl_setopt($chCURLOPT_RETURNTRANSFER1);
        
$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); 

Poslednja izmena od webarto : 19. 05. 2011. u 18:24.
webarto je offline   Odgovorite uz citat