Created
May 2, 2018 14:40
-
-
Save LouLeGrain/3bbfa7095279cf98aed9b403723e190b to your computer and use it in GitHub Desktop.
[String formatting] Formater une entrée utilisateur à caractères spéciaux #PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$nomFichier = strtr($fichier, | |
'ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿ', | |
'AAAAAACEEEEIIIIOOOOOUUUUYaaaaaaceeeeiiiioooooouuuuyy'); | |
$nomFichier = preg_replace('/([^.a-z0-9]+)/i', '-', $fichier); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment