0

I've a problem with date language can't displaying it in arabic neither french ..i've tried all syntaxes possible , it seems that setlocale doesnt work ,any help will be appreciated

setlocale(LC_TIME, 'fr_FR.UTF8', 'fr.UTF8', 'fr_FR.UTF-8', 'fr.UTF-8');
setlocale(LC_ALL, 'fr_FR.UTF8', 'fr.UTF8', 'fr_FR.UTF-8', 'fr.UTF-8');
setlocale(LC_ALL,'fr_FR','french','French_France.1252','fr_FR.ISO8859-1','fra')
setlocale (LC_ALL, 'french');
setlocale (LC_ALL, 'fra');
setlocale(LC_ALL, 'fr_FR');
setlocale(LC_TIME, "fra");
setlocale( LC_ALL,'ar-ma' );
Hasnae Idem
  • 39
  • 1
  • 10

1 Answers1

0

@Hasnae Idem I don't exactly understand why you need it so complected, but here you are a key for how does the setlocale working with Arabic language for example sorting arabic characters well from أ to ي sure you can do the same with other languages such as French

Note: this example contains arabic characters

$lang = array('هدهد','يارا', 'باسم', 'اسامة', 'جمال');
echo '<pre>'; print_r($lang); echo '</pre>';
setlocale(LC_ALL,'ar_AE.utf8');
sort($lang,SORT_LOCALE_STRING);
echo '<pre>'; print_r($lang); echo '</pre>';
usama sulaiman
  • 2,013
  • 4
  • 24
  • 37