Keys →
Functions ↓
function showSunMoonInfo ( $lat, $lon, $tim=0 ) {#-k geo weather#-p $lat - req - latitude#-p $lon - req - longitude#-p $tim - opt - int time - if 0 (default) use current time#-p - ret - returns an array if (!$tim) $tim = time(); $da = date ( 'Ymd', $tim ); $str = 'fmt=json&date=' . $da . '&lat=' . $lat . '&lon=' . $lon; $url = 'http://t1.gwilt.org/moon.php?' . $str; $ch = curl_init(); curl_setopt ( $ch, CURLOPT_URL, "$url" ); curl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, 2 ); curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 ); $res = curl_exec($ch); // Look at the returned header $resultArray = curl_getinfo($ch); curl_close ( $ch ); $resultArray['result'] = $res; $r = json_decode( $resultArray['result'], true ); $r['sun'] = sortByValue ( $r['sun'] ); return $r; }?>