CakeFest 2024: The Official CakePHP Conference

IntlCalendar::getType

(PHP 5 >= 5.5.0, PHP 7, PHP 8, PECL >= 3.0.0a1)

IntlCalendar::getTypeRécupère le type de calendrier

Description

Style orienté objet

public IntlCalendar::getType(): string

Style procédural

intlcal_get_type(IntlCalendar $calendar): string

Une chaîne de caractères décrivant le type de ce calendrier. Cette chaîne sera une parmi les valeurs valides du mot clé 'calendar' du calendrier.

Liste de paramètres

calendar

Une instance IntlCalendar.

Valeurs de retour

Une chaîne de caractères string représentant le type de calendrier, par exemple, 'gregorian', 'islamic', etc.

Exemples

Exemple #1 Exemple avec IntlCalendar::getType()

<?php
ini_set
('date.timezone', 'Europe/Lisbon');
ini_set('intl.default_locale', 'en_US');

$cal = IntlCalendar::createInstance(NULL, '@calendar=ethiopic-amete-alem');
var_dump($cal->getType());

$cal = new IntlGregorianCalendar();
var_dump($cal->getType());

L'exemple ci-dessus va afficher :

string(19) "ethiopic-amete-alem"
string(9) "gregorian"

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top