note 62115 deleted from function.setlocale by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 14:55:33 +0000 |
| Subject: | note 62115 deleted from function.setlocale by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-197242@lists.php.net to get a copy of this message | ||
Note Submitter: bruno dot cenou at revues dot org
----
A little function to test available locales on a sytem :
<?php
function list_system_locales(){
ob_start();
system('locale -a');
$str = ob_get_contents();
ob_end_clean();
return split("\\n", trim($str));
}
$locale = "fr_FR.UTF8";
$locales = list_system_locales();
if(in_array($locale, $locales)){
echo "yes yes yes....";
}else{
echo "no no no.......";
}
?>