Pogledajte određenu poruku
Staro 07. 06. 2011.   #61
AdriaMart
expert
Expert
 
Avatar AdriaMart
 
Datum učlanjenja: 15.03.2011
Poruke: 518
Hvala: 16
20 "Hvala" u 17 poruka
AdriaMart is on a distinguished road
Default

Ne radi ...

<?php




$dom = new DOMDocument();
@$dom->loadHTMLFile('http://www.popusti.rs/offer/today');
$xpath = new DOMXPath($dom);
$entries = $xpath->query("//div[@id='wrapper']//h3//a/@href");
$output = array();
foreach($entries as $e) {
$dom2 = new DOMDocument();
@$dom2->loadHTMLFile('http://www.popusti.rs' . $e->textContent);
$xpath2 = new DOMXPath($dom2);
$data = array();

$regex = '!\.LatLng\(\s*(\d+\.\d+)\s*,\s*(\d+\.\d+)\)!';
preg_match($regex, $str, $match);
$data['lat'] = $match[1];
$data['lng'] = $match[2];


$output[] = $data;
}


echo '<pre>' . print_r($output, true) . '</pre>';


?>
AdriaMart je offline   Odgovorite uz citat