Warning: Invalid argument supplied for foreach() in /home/jihswbiz/public_html/t6.gwilt.org/refDox.php on line 212
Docs-showSunMoonInfo

 

ReLoad

Keys


Functions

arraybrowsercolorcookiedatetimeDBdebugdeviceDSTequiverrorflagsfontformatgeo
holidayhtmlisjsonmathparsePHPprintsearchsortstringtabletexttracetype
VOTDweatherxml

Function  showSunMoonInfo   Lines 20-48 (28 lines) file  utilsCoords.php   Last mod: Tue 2021-04-06 21:34:28

function showSunMoonInfo $lat$lon$tim=)
        {
#-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 $chCURLOPT_URL"$url);
        
curl_setopt $chCURLOPT_CONNECTTIMEOUT);
        
curl_setopt $chCURLOPT_RETURNTRANSFER);
        
$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;
        }

?>