Nono.MA

Replace Multiple Spaces with One Spaces in PHP

JANUARY 23, 2020

$output = preg_replace('!\s+!', ' ', $input);

From StackOverflow.

CodePhp