1. remove multiple spaces from textarea
2. space at the end of the string...
Code: Select all
function space($string) {
$string = eregi_replace('^[[]]+', '',preg_replace('/\s+/', ' ', $string));
return $string;
}example:
Hi...
How are you?
with the function above it will result
Hi... How are you?
... removing me the line break and I only want to remove extra spaces