PHP function to remove whitespaces from a string

Usage :

$spaceRemovedString = removeWhiteSpaces($stringWithSpace);

 

Function :

function removeWhiteSpaces($spaceStr)
{
	$newStr = preg_replace('/\s+/', '', $spaceStr);
	return $newStr;
}
  1. No comments yet.

  1. No trackbacks yet.


− one = 3