0){ $encodedquery = urlencode($query); $url = "http://openapi.naver.com/search?query=$encodedquery&target=local&key=".NAVERKEY; $data = file_get_contents($url); $result = simplexml_load_string($data); $list = array(); $result = $result->channel; foreach($result->item as $item){ $title = $item->title.""; $link = $item->link.""; $desc = $item->description.""; $tel = $item->telephone.""; $addr = $item->address.""; $mapx = $item->mapx."" ; $mapx = round($mapx / 100); $mapy = $item->mapy."" ; $mapy = round($mapy / 100); $minx = min($minx, $mapx); $maxx = max($maxx, $mapx); $miny = min($miny, $mapy); $maxy = max($maxy, $mapy); $tmparr = array($title, $link, $desc, $tel, $addr, $mapx, $mapy); array_push($list, $tmparr); } $intVal = 30; $minx -= $intVal; $maxx += $intVal; $miny -= $intVal; $maxy += $intVal; } ?> source