dimanche 26 mai 2019

string encoding in laravel of data coming from route url

I'am working with lumen framwork , here is my url :

http://127.0.0.1:8000/école

I want to get the string after the domain name
I get this : %C3%A9cole
I want to get this : ecole

... function search($name)
{
$patterns[0] = '/[á|â|à|å|ä]/';
$patterns[1] = '/[ð|é|ê|è|ë]/';
$patterns[2] = '/[í|î|ì|ï]/';
$patterns[3] = '/[ó|ô|ò|ø|õ|ö]/';
$patterns[4] = '/[ú|û|ù|ü]/';
$patterns[5] = '/æ/';
$patterns[6] = '/ç/';
$patterns[7] = '/ß/';
$replacements[0] = 'a';
$replacements[1] = 'e';
$replacements[2] = 'i';
$replacements[3] = 'o';
$replacements[4] = 'u';
$replacements[5] = 'ae';
$replacements[6] = 'c';
$replacements[7] = 'ss';
return preg_replace($patterns, $replacements, $name);
...



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire