RE: [PHP] strip white space

From: Date: Wed, 02 Jul 2003 16:53:08 +0000
Subject: RE: [PHP] strip white space
Groups: php.general 
Request: Send a blank email to php-general+get-153733@lists.php.net to get a copy of this message
would $team_name = trim(ereg_replace( " +", " ", $team_name )); do it? -----Original Message----- From: Steve Buehler [mailto:steve@ibapp.com] Sent: Wednesday, July 02, 2003 9:50 AM To: PHP Subject: [PHP] strip white space I am not sure how to go about this and hope that someone can help here. I have a variable like the following: $team_name="BV Stars Black"; it has two spaces between the words Stars and Black. What I am trying to do is to take this variable, check for and strip the following: 1. Leading spaces 2. Ending spaces 3. Double (or more) spaces in the variable leaving only one space between words. Does php have any built in function that I can not find that will do this? Thank You in Advance Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#153733) next »