Removing WhiteSpace
| From: | Grant Walters | Date: | Sun, 10 Sep 2000 01:29:54 +0000 |
| Subject: | Removing WhiteSpace | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-16018@lists.php.net to get a copy of this message | ||
Hi,
A bit lazy I guess, but I'm having trouble trying to replace multiple spaces
in a string.
I'm concatenating variables from a form such as
$string=$Salutation.$First_Name.$Initial.$Surname
The string could be "Mr Grant Walters" and I want "Mr Grant Walters".
I looked at preg_replace but don't really understand it. I keep getting
empty strings.
Regards
GRANT WALTERS
Walters & Associates, P O Box 13-043, Johnsonville, Wellington, New Zealand
Phone: +64 4 4765175 CellPhone: 025 488265