Get information about sunset/sunrise and twilight begin/end for latitude and longitude in PHP

Description

The following code shows how to get information about sunset/sunrise and twilight begin/end for latitude and longitude.

Example


/*from   w w  w  . j ava  2  s .  co  m*/
<?php
    $sun_info=date_sun_info(strtotime("2013-01-01"),31,35);
    foreach ($sun_info as $key=>$val){
          echo "$key: " . date("H:i:s",$val) . "<br>";
    }
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Data Types »




Array
Array Associative
Array Util
ArrayObject
Data Types
Date
Date Format
DateTime
Number
String
String Escape
String Filter
String HTML
String Type
Timezone