|
|
PHP date_sunset() Function
|
Tutorials » Php »
|
Topic |
What is a Date Sunset Function?
|
|
Explanation |
|
The "date_sunset()" function returns an array with the information about the sunset/sunrise and twilight
begin/end.
Syntax:
date_sunset(timestamp,format,latitude,longitude,zenith,gmt_offset)
In the above syntax "$time" is the timestamp, logitude,latitude in degrees.
Example:
<?php
echo("Sunset time: ");
echo(date_sunset(time(),SUNFUNCS_RET_STRING,38.4,-9,90,1));
?>
Result:
Sunset time: 20:56
In the above example the date_sunset() function will display sunset time for the given timetamp, "SUNFUNCS_RET_STRING" returns the
sunset time as a string, for the given latitude,longitude.
Note: (PHP 5)
|
|
A Note |
Learn PHP programming language tutorial with simple and neat example. Hope you enjoy this free tutorial.
Do give us your valuable feedback and suggestions on this online tutorial. This is a Copyright Content.
|
|
|
|