Calculate Moon Phase Data with PHP III

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

2 comments:

PuMi said...

In Astro_MoonPhase.php
code - "require_once 'PEAR.php';" ??

Newton Pasqualini said...

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?