php remove all whitespace from a string
$string = str_replace(' ', '', $string);
3.63
8
//remove all white spaces from a string
$whatonearth=preg_replace('/\s/','',"what o n ear th");
Thank you!
8
0
0
10
$string = "this is my string"
$string = preg_replace('/\s+/', '', $string);
Thank you!
10
0
Are there any code examples left?
New code examples in category PHP