PHP | IntlCalendar getAvailableLocales() Function
Last Updated :
25 Sep, 2019
The IntlCalendar::getAvailableLocales() function is an inbuilt function in PHP which is used to display an array list of locales for which calendars are installed.
Syntax:
Parameters: This function does not accept any parameters.
Return Value: This function returns an array of strings which contains the locale value.
Below programs illustrate the IntlCalendar::getAvailableLocales() function in PHP:
Program 1:
<?php
var_dump(IntlCalendar::getAvailableLocales());
?>
|
Output:
array(683) {
[0]=>
string(2) "af"
[1]=>
string(5) "af_NA"
[2]=>
string(5) "af_ZA"
[3]=>
string(3) "agq"
[4]=>
string(6) "agq_CM"
[5]=>
string(2) "ak"
...
}
Program 2:
<?php
var_dump(intlcal_get_available_locales());
?>
|
Output:
array(683) {
[0]=>
string(2) "af"
[1]=>
string(5) "af_NA"
[2]=>
string(5) "af_ZA"
[3]=>
string(3) "agq"
[4]=>
string(6) "agq_CM"
[5]=>
string(2) "ak"
...
}
Reference: https://www.php.net/manual/en/intlcalendar.getavailablelocales.php
Share your thoughts in the comments
Please Login to comment...