01 | | 02 | | 03 | | 04 | | 05 | | 06 | | 07 | | 08 | | 09 | | 10 | | 11 | | 12 | | 13 | | 14 | | 15 | | 16 | | 17 | | 18 | | 19 | | 20 | | 21 | | 22 | | 23 | | 24 | | 25 | | 26 | | 27 | | 28 | | 29 | | 30 | | 31 | | 32 | | 33 | | 34 | | 35 | | 36 | | 37 | | 38 | | 39 | | 40 | | 41 | | 42 | | 43 | | 44 | | 45 | | 46 | | 47 | | 48 | | 49 | | 50 | | 51 | | 52 | | 53 | |
|
<?php
| /*---------------------------------------------------------------*/
| /*
| Titre : Passer une chaine utf8 en Latin
|
| URL : https://phpsources.net/code_s.php?id=442
| Date édition : 13 Aout 2008
| Date mise à jour : 14 Aout 2019
| Rapport de la maj:
| - fonctionnement du code vérifié
| - amélioration du code
| */
| /*---------------------------------------------------------------*/
|
| function utf8_vers_latin($machaine)
| {
|
| $tab_utf8 = Array("/ç/","/ä§/","/é/","/ä©/","/è/","/ä¨/","/ê/",
| "/äª/",
| "/à«/","/ä«/","/à/","/ä/","/à/","/ä/","/à®/",
| "/ä®/",
| "/ï/","/ä¯/","/à¬/","/à/","/ä/","/à²/","/ä²/",
| "/ô/",
| "/ä´/","/à¶/","/ä¶/","/àµ/","/à³/","/à¸/",
| "/äµ/","/ä³/",
| "/ä¸/","/à/","/ä/","/à/","/ä/","/à/","/ä/",
| "/à¢/",
| "/ä¢/","/à¤/","/ä¤/","/à¥/","/ä¥/","/à/","/ä/"
| ,"/à/",
| "/ä/","/à¹/","/à»/","/à¼/","/ä¼/","/à/","/à/",
| "/ä¹/",
| "/ä»/","/ä¼/","/ä¼/","/ä/","/ä/","/à²/","/à±/"
| ,"/â/");
|
| $tab_latin = Array("ç", "ç", "é", "é", "è", "è", "ê", "ê", "ë",
| "ë", "Ê", "Ê",
| "Ë", "Ë", "î", "î", "ï", "ï", "ì", "Î", "Î",
| "ò", "ò", "ô",
| "ô", "ö", "ö", "õ", "ó", "ø", "õ", "ó", "ø",
| "Ô", "Ô", "Ö",
| "Ö", "à", "à", "â", "â", "ä", "ä", "å", "å",
| "Â", "Â", "Ä",
| "Ä", "u", "û", "ü", "ü", "Û", "Ü", "u", "û", "ü",
| "ü", "Û",
| "Ü", "ñ", "ñ", "'");
|
| $machaine = preg_replace($tab_utf8, $tab_latin, $machaine);
|
| return $machaine;
| }
| ?>
|
| |
|