Arabic
[ class tree: Arabic ] [ index: Arabic ] [ all elements ]

Procedural File: Salat.class.php

Source Location: /sub/Salat.class.php



Classes:

Salat
This PHP class calculate the time of Muslim prayer according to the geographic location.


Page Details:

----------------------------------------------------------------------

Copyright (C) 2009 by Khaled Al-Shamaa.

http://www.ar-php.org

----------------------------------------------------------------------

LICENSE

This program is open source product; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/lgpl.txt>.

----------------------------------------------------------------------

Class Name: Muslim Prayer Times

Filename: Salat.class.php

Original Author(s): Khaled Al-Sham'aa <khaled.alshamaa@gmail.com>

Purpose: The five Islamic prayers are named Fajr, Zuhr, Asr, Maghrib and Isha. The timing of these five prayers varies from place to place and from day to day. It is obligatory for Muslims to perform these prayers at the correct time.

----------------------------------------------------------------------

Source: http://qasweb.org/qasforum/index.php?showtopic=177&st=0 By: Mohamad Magdy <mohamad_magdy_egy@hotmail.com>

----------------------------------------------------------------------

Muslim Prayer Times

Using this PHP Class you can calculate the time of Muslim prayer according to the geographic location.

The five Islamic prayers are named Fajr, Zuhr, Asr, Maghrib and Isha. The timing of these five prayers varies from place to place and from day to day. It is obligatory for Muslims to perform these prayers at the correct time.

The prayer times for any given location on earth may be determined mathematically if the latitude and longitude of the location are known. However, the theoretical determination of prayer times is a lengthy process. Much of this tedium may be alleviated by using computer programs.

Definition of prayer times

  • FAJR starts with the dawn or morning twilight. Fajr ends just before sunrise.
  • ZUHR begins after midday when the trailing limb of the sun has passed the meridian. For convenience, many published prayer timetables add five minutes to mid-day (zawal) to obtain the start of Zuhr. Zuhr ends at the start of Asr time.
  • The timing of ASR depends on the length of the shadow cast by an object. According to the Shafi school of jurisprudence, Asr begins when the length of the shadow of an object exceeds the length of the object. According to the Hanafi school of jurisprudence, Asr begins when the length of the shadow exceeds TWICE the length of the object. In both cases, the minimum length of shadow (which occurs when the sun passes the meridian) is subtracted from the length of the shadow before comparing it with the length of the object.
  • MAGHRIB begins at sunset and ends at the start of isha.
  • ISHA starts after dusk when the evening twilight disappears.
Example:
  1.      date_default_timezone_set('UTC');
  2.  
  3.      include('./Arabic.php');
  4.      $Ar new Arabic('Salat');
  5.  
  6.      $Ar->Salat->setLocation(33.513,36.292,2);
  7.      $Ar->Salat->setDate(date('j')date('n')date('Y'));
  8.  
  9.      $times $Ar->Salat->getPrayTime();
  10.  
  11.      echo '<b>Damascus, Syria</b><br />';
  12.      echo date('l F j, Y').'<br /><br />';
  13.  
  14.      echo "<b class=hilight>Fajr:</b> {$times[0]}<br />";
  15.      echo "<b class=hilight>Sunrise:</b> {$times[1]}<br />";
  16.      echo "<b class=hilight>Zuhr:</b> {$times[2]}<br />";
  17.      echo "<b class=hilight>Asr:</b> {$times[3]}<br />";
  18.      echo "<b class=hilight>Maghrib:</b> {$times[4]}<br />";
  19.      echo "<b class=hilight>Isha:</b> {$times[5]}<br />";




Tags:

author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
copyright:  2009 Khaled Al-Shamaa
link:  http://www.ar-php.org
license:  LGPL








Documentation generated on Tue, 18 Aug 2009 00:12:52 +0300 by phpDocumentor 1.4.0