PHP Classes

PHP Muslim Salat Times Calculation: Calculate muslim prayer times in any world city

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 169 All time: 8,861 This week: 44Up
Version License PHP version Categories
salatclass 1GNU General Publi...5Algorithms, PHP 5, Geography
Description 

Author

This package is specific mainly for applications used in Saudi Arabia Saudi Arabia .

This class can calculate muslim prayer times in any world city.

It can take the geographic coordinates, time zone and twilight values of a given city and calculates the times that pray time should occur.

The class can calculate pray times for a specific day and returns an array of the 5 pray times for that day.

Picture of KHALID
Name: KHALID <contact>
Classes: 1 package by
Country: Morocco Morocco

Example

<?php
 
require_once('salatClass.class.php');

 
//$city array($name, $latitude, $longitude, $time_zone, $Fajr_twilight, $Isha_twilight, $asr_hanafi)
  
$city = array("Tanger", "35.7847" , "-5.8128", 0, -19.5, -17.5, false);

 
//Minutes to add/remove frm calcilations for more accuracy, if any. array($Fajr, $Dhohr, $Asr, $Maghrib, $Isha)
 
$mintoadd = array(0,0,0,0,0);

 
//Date to calculae for, default today array($year, $month, $day)
 
$DayToCalculate = array(date('Y'), date('m'), date('d'));

 
$salat = new SalatTimes($city, $mintoadd, $DayToCalculate);

 
$tm = $salat->calculate();
  for (
$i=0; $i < 5 ; $i++)
  {
    echo
$tm[$i] . '<br>';
  }



?>


  Files folder image Files (2)  
File Role Description
Accessible without login Plain text file example.php Example Example file
Plain text file salatClass.class.php Class Main salat class

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:169
This week:0
All time:8,861
This week:44Up