Re: Excel Spreadsheet / Remove White Space
| From: | Justin Patrin | Date: | Wed, 22 Aug 2007 17:00:16 +0000 |
| Subject: | Re: Excel Spreadsheet / Remove White Space | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-27841@lists.php.net to get a copy of this message | ||
On 8/20/07, Tom Synnott <tom@curiousclothing.com> wrote:
> Hi all,
>
> I am downloading mobile numbers into an Excel spreadsheet... I want
> to remove the whitespace, some are formatted like so 0000 000 000 and
> others are 0000000000, I want to make them all load into Excel as
> 0000000000... Anyone know if that's possible?
>
php.net/str_replace or php.net/preg_replace
$str = preg_replace('/\s+/', '', $str);
--
Justin Patrin