PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Marco Palmieri  >  Moon  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: usage example
Class: Moon
Calculate the phase of the Moon for a given date
Author: By
Last change: new methods
Date: 12 years ago
Size: 570 bytes


Class file image Download

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:
next new moon:
next full moon: