Hapus semua spasi PHP
$string = "this is my string"
$string = preg_replace('/\s+/', '', $string);
King Pinaster
$string = "this is my string"
$string = preg_replace('/\s+/', '', $string);
//remove all white spaces from a string
$whatonearth=preg_replace('/\s/','',"what o n ear th");