Location: PHPKode > scripts > Moon > example.php
<?php

    include "moon.php";
    $moon = new moon();

    if ($moon->set("date", date("Y-m-d"))) {

        $phase_name = $moon->get_phase_name();
        $phase_at = $moon->get_phase_percent();
        $visibility = $moon->get_visibility();
        $next_newmoon = $moon->get_next_newmoon();
        $next_fullmoon = $moon->get_next_fullmoon();

        echo <<<MOON_INFO
phase name: {$phase_name}
phase percentage: {$phase_at}%
visibility: {$visibility}%
next new moon: {$next_newmoon}
next full moon: {$next_fullmoon}
MOON_INFO;
   
    }

?>
Return current item: Moon