i have form accepts tabbled white space " " example. want allow 1 space between words.
currently looks this:
preg_replace ("#[^0-9a-z]#i", " ",$string);
remember need allow 1 space @ time, how fix this?
replace multiple whitespaces single space
$string = preg_replace('/\s\s+/',' ', $string);
Comments
Post a Comment