Yet another awesome update to the PHP-based moon phase script, which was a translation of the Perl Astro::MoonPhase module. This module is designed to calculate the phase of the moon for a particular date or set of dates, and is very accurate - and also pretty awesome, did I mention that?
Christopher Hopper was kind enough to work the code into a PHP class, with doxygen-style comments and everything! The class as well as an example script is included in the archive linked below. A big thanks to Christopher for doing all this work. Enjoy!
PHP Class and Example Script --> Astro-MoonPhase.zip
Calculate Moon Phase Data with PHP III
Posted by
SteveZ on February 4, 2009
3 comments:
In Astro_MoonPhase.php
code - "require_once 'PEAR.php';" ??
Hi there,
I try to get the moon phase using this script and it is saying 4% Illuminated when it is 1%.
The question is, the lat/lng and the timezone will make some mistakes like that???
What should I do, I live in Sao Paulo, Brazil, my timezone is UTC -3 there is needed some adjusts into the constants?
Warning: require_once(PEAR.php) [function.require-once]: failed to open stream: No such file or directory in \Astro_MoonPhase.php on line 56.
No file pear.php?
Post a Comment