Git Product home page Git Product logo

salah-prayer-times-1's Introduction

Salah Prayer Times 1

PHP library for prayer times based on C library from ArabEyes: https://github.com/arabeyes-org/ITL/tree/master/prayertime

How to use

Prayer times need the following information to be generated:

  • Latitude
  • Longitude
  • GMT offset
  • Date

To use simple include the main core file see Example.php for usage:

define('DS', DIRECTORY_SEPARATOR);
require dirname(__FILE__) . DS . 'core' . DS . 'Prayer_Times.php';

Then intialize a location/setting object:

$settings               = new Settings('US');
$settings->location     = array('Detroit', 'Michigan', 'US');
$settings->latitude     = 42.4056;
$settings->longitude    = -83.0531;
$settings->timezone     = 'America/Detroit';

This will automatically assign the method/madhab based on the country (US). Not not all countries have defaults so you can do the following additional sets:

$settings->method = 4; // See below for complete list of methods
$settings->juristic = 0; // (0 - Shafi/Hanbli/Maliki, 1 - Hanafi)

To access prayer times you call the prayer time library as so:

$prayer = new Prayer_Times($settings);
$times = $prayer->getPrayerTimes(25, 12, 2017);
echo '--------------------';
echo 'Salah Times for December 25th, 2017' . PHP_EOL;
echo 'Fajir: '      . format_am_pm($times[0]) . PHP_EOL;
echo 'Duha: '       . format_am_pm($times[1]) . PHP_EOL;
echo 'Dhur: '       . format_am_pm($times[2]) . PHP_EOL;
echo 'Asr: '        . format_am_pm($times[3]) . PHP_EOL;
echo 'Maghrib: '    . format_am_pm($times[4]) . PHP_EOL;
echo 'Isha: '       . format_am_pm($times[5]) . PHP_EOL;

Methods

  1. Jafari - Ithna Ashari
  2. Karachi - University of Islamic Sciences
  3. ISNA - Islamic Society of North America
  4. MWL - Muslim World League
  5. Mecca - Umm al-Qura
  6. Egyptian General Authority of Survey
  7. Custom Setting
  8. University of Tehran - Institute of Geophysics
  9. Algerian Minister of Religious Affairs and Wakfs
  10. Gulf 90 Minutes Fixed Isha
  11. Egyptian General Authority of Survey (Bis)
  12. UOIF - Union Des Organisations Islamiques De France
  13. Sistem Informasi Hisab Rukyat Indonesia
  14. Diyanet İşleri Başkanlığı
  15. Germany Custom
  16. Russia Custom

Need help or have any question?

Contact us at [email protected]. You can also visit us at SalahHour.com

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.