Today now in this example i will show you How to remove white space from string in PHP? Sometimes we need to remove the white space from the given string. So at that times we need to delete the spaces from string by using str_replace() of core php. we know str_replace() will help us to replace the white space on that way we can remove this. So we can do this from the bellow example.
$myString = "this is only for you"; $resultString = str_replace(' ', '', $myString); print_r($resultString);
Thanks for read. I hope it help you. For more you can follow us on facebook