<?php $text = "<p>Hello World! Javascript development PHP Developer </p>"; $result = preg_replace(["/\s* (?:\s* )*\s*/", "/\s+/"], [' ',' '], $text); echo $result;
You have javascript disabled. You will not be able to edit any code.