php - How to give space in sentence in string with preg_replace?
one text
Solution:
You can replace all chars other than lowercase letters with a space and the string:
$kamar = "12223233 sekamar berempat";
echo trim(preg_replace("/[^a-z]+/", " ", $kamar));
// => sekamar berempat
See the PHP demo.
Source