If you don't want to perform string manipulations, you can probably do something more "hacked":
$string = $nextDisponibility->formatLocalized('%A ')
.trim($nextDisponibility->formatLocalized("%e"))
.$nextDisponibility->formatLocalized(" %B ")
.ltrim($nextDisponibility->formatLocalized("%kh%M"));
However $string = str_replace(' ',' ',$nextDisponibility->formatLocalized('%A %e %B à %kh%M'))
, it is probably better if you do not need other double spaces.
source
share