This is my variable to be altered:
$last = 'Some string 1 foobar'
and my replace statement
$last = str_replace(['1', '2'], '', $last);
and finally the output
Some string foobar
How do i get rid of the whitespace in between 'string' and 'foobar', my initial thought was that in my str_replace
statement using ''
as the replacement would also remove the whitespace but it doesnt.
To clarify I want to know how to make it Some string foobar
and not Some stringfoobar
.