Bonjour @tous!
Voila je fais une mise a jour d'une table ou des adresses ont été rentré comme ceci :
MARECHAL FOSH - RUE DE
ET je souhaiterais le replacé comme suit :
RUE DE MARECHAL FOSH
Voilou..
MERCI pour votre help!
<?php
$string = "MARECHAL FOSH - RUE DE";
$tab = explode ("-",$string);
$newString = trim($tab[1])." ".trim($tab[0]);
echo $newString;
?>
Explode() te créer un tableau, trim() efface les éventuels espaces qui résident.