Manuel PHP

date_sun_info

(PHP 5 >= 5.1.2)

date_sun_info — Retourne un tableau avec les informations sur lever/coucher du soleil ainsi que le début et la fin de l'aube

Description

array date_sun_info ( int $time , float $latitude , float $longitude )

Liste de paramètres

time

Timestamp.

latitude

Latitude en degrés.

longitude

Longitude en degrés.

Valeurs de retour

Retourne un tableau en cas de succès ou FALSE en cas d'échec.

Exemples

Example#1 Exemple avec date_sun_info()

  1. <?php
  2. $sun_info = date_sun_info(strtotime("2006-12-12"), 31.7667, 35.2333);  
  3. foreach ($sun_info as $key => $val) { 
  4.    echo "$key:" . date("H:i:s", $val) . "\n";  
  5. }  
  6. ?> 

L'exemple ci-dessus va afficher :

sunrise: 05:52:11 sunset: 15:41:21 transit: 10:46:46 civil_twilight_begin: 05:24:08 civil_twilight_end: 16:09:24 nautical_twilight_begin: 04:52:25 nautical_twilight_end: 16:41:06 astronomical_twilight_begin: 04:21:32 astronomical_twilight_end: 17:12:00


Remonter Remonter
L'éditeur javascript - CSS - Gentoo - Tutoriaux PHP - Tutoriels PHP - Breizh Blog