PHP code example of jiri.jozif / moonriset

1. Go to this page and download the library: Download jiri.jozif/moonriset library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jiri.jozif / moonriset example snippets




use JiriJozif\Moonriset\Moonriset;

$mrs = new Moonriset(51.48, 0.0, "Europe/London"); //Royal Observatory, Greenwich
echo "Moon rises today at {$mrs->rise["hh_mm"]} and sets at {$mrs->set["hh_mm"]}";



use JiriJozif\Moonriset\Moonriset;

$mrs = new Moonriset(51.48, 0.0, "Europe/London"); //Royal Observatory, Greenwich
$mrs->setDate(2025, 12, 31);
echo "Moon rises last day of year 2025 at {$mrs->rise["hh_mm"]} and sets at {$mrs->set["hh_mm"]}";