reduce multiple space with single space using regex
by Guna[ Edit ] 2014-02-21 12:53:02
Following snippet will replace multiple white spaces into single, this will be useful when we add user name,titles in database...
$name='Guna sekar v';
$name=preg_replace('/ss+/',' ',$name);
echo $name;
Output:
Guna sekar v