How to remove all spaces from string in php?
In this post, use the PHP preg_replace() function to strip or remove all whitespaces inside a string.
1. Code:
2. Example:
Input:
$str ="Soltuts.com
is providing PHP
tutorials";
Output:
Soltuts.comisprovidingPHPtutorials