note 100332 modified in function.date-sun-info by danbrown
| From: | danbrown@php.net | Date: | Fri, 08 Oct 2010 16:49:35 +0000 |
| Subject: | note 100332 modified in function.date-sun-info by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-173083@lists.php.net to get a copy of this message | ||
I have been working on my own php script to get current down or up for sun and moon. I had to add
function for any places that have 24 hour sun.
here is my code for places with 24 hour sun.
<?php
if ($sunrise == 0 && $sunset == 0) {
$sunrise24 = "";
$sunset24 = "";
//run suninfo
$sunup = date_sun_info(strtotime($year."-".$month."-".$day), $lat, $lon);
}
//check if sun is up all day.
if ($sunup[sunrise] == 1 && $sunup[sunrise] == 1) {
imagecopy($sky, $sun, 60, 20, 0, 0, $sun_width, $sun_height);
imagefill($sky, 0, 0, $bluesky);
}
?>
--was--
I have been working on my own php script to get current down or up for sun and moon. I had to add
function for any places that have 24 hour sun.
here is my code for places with 24 hour sun.
if ($sunrise == 0 && $sunset == 0) {
$sunrise24 = "";
$sunset24 = "";
//run suninfo
$sunup = date_sun_info(strtotime($year."-".$month."-".$day), $lat, $lon);
}
//check if sun is up all day.
if ($sunup[sunrise] == 1 && $sunup[sunrise] == 1) {
imagecopy($sky, $sun, 60, 20, 0, 0, $sun_width, $sun_height);
imagefill($sky, 0, 0, $bluesky);
}
http://php.net/manual/en/function.date-sun-info.php