RE: [PHP] strip spaces from inside string
| From: | Rick Emery | Date: | Tue, 26 Mar 2002 20:12:45 +0000 |
| Subject: | RE: [PHP] strip spaces from inside string | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-90265@lists.php.net to get a copy of this message | ||
<?php
$old = "xyz abc def";
$newstr = ereg_replace(" ","",$old);
?>
-----Original Message-----
From: Chuck Barnett [mailto:xobyte@bellsouth.net]
Sent: Sunday, February 03, 2002 2:01 PM
To: PHP General List
Subject: [PHP] strip spaces from inside string
Say I have a string "xyz abc def" and I want to remove all of the spaces
withing the string to create a new one. What's the best way?
Thanks,
ChuckB
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php