English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Tutoriel PHP de base

Tutoriel PHP avancé

PHP & MySQL

Manuel de référence PHP

Utilisation et exemple de la fonction PHP cal_info()

PHP Calendar Fonction manuel du calendrier

 La fonction cal_info() retourne les informations du calendrier sélectionné

Syntaxe

cal_info ( [$calendar] );

Définition et utilisation

La fonction cal_info() retourne un tableau contenant des informations sur le calendrier donné. Ce tableau contient les éléments suivants : calname, calsymbol, month, abbrevmonth et maxdaysinmonth.

Paramètres

NuméroParamètres et explications
1

calendar

Optionnel. Spécifiez le calendrier. Vous pouvez utiliser les valeurs de calendrier suivantes-

  • 0 = CAL_GREGORIAN

  • 1 = CAL_JULIAN

  • 2 = CAL_JEWISH

  • 3 = CAL_FRENCH

Valeur de retour

Contient un tableau d'informations sur le calendrier donné. Retourne le nom du calendrier spécifié, sinon retourne tous les calendriers.

Exemple en ligne

<?php
   $info = cal_info(0);
   print_r($info);
?>

Résultat de la sortie :

Array (
   [months] > Array (
      [1] > January
      [2] > February
      [3] > March
      [4] > April
      [5] > May
      [6] > June
      [7] > July
      [8] > August
      [9] > September
      [10] > October
      [11] > November
      [12] > December
   )
   [abbrevmonths] > Array (
      [1] > Jan
      [2] > Feb
      [3] > Mar
      [4] > Apr
      [5] > May
      [6] > Jun
      [7] > Jul
      [8] > Aug
      [9] > Sep
      [10] > Oct
      [11] > Nov
      [12] > Dec
   )
   [maxdaysinmonth] > 31
   [calname] > Gregorian
   [calsymbol] > CAL_GREGORIAN
)

  PHP Calendar Fonction manuel du calendrier