The workstation I'm on is only running 4.0.4...
perhaps it's time to upgrade. :)
I'll try it again.
On Fri, 20 Jul 2001 10:30:18 -0400 "Jack Dempsey" wrote:
> Actually, it does. I just ran it again with that exact code. What
> version of php are you running?
> Here's a direct copy/paste of what I get:
>
> <code>
> <?
> $text = "This contans white space .";
> $matches = preg_split("/(\s+)/",$text,-1, PREG_SPLIT_DELIM_CAPTURE);
> echo "<pre>[$text]<br>[". implode('',$matches)."]</pre>";
> ?>
> </code>
>
> <ouput>
> <pre>[This contans white space .]<br>[This contans white space
> .]</pre>
> </output>
>
> Are you running php >= 4.0.5?
>
> jack
> -----Original Message-----
> From: Garth Dahlstrom [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 20, 2001 10:06 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] Re: split on whitespace, preserving whitespace...
>
> On Fri, 20 Jul 2001 09:32:00 -0400 "Jack Dempsey" wrote:
>
> >
> > $text = "This contans white space .";
> > $matches = preg_split("/(\s+)/",$text,-1, PREG_SPLIT_DELIM_CAPTURE);
> > echo implode('',$matches);
>
> Nope that doesn't do it.
> here's the test:
> echo "<pre>[$text]<br>[". implode('',$matches)."]</pre>";
>
> here's the output:
> [This contans white space .]
> [Thiscontanswhitespace.]
>
> If it were working the two lines should be identical.
>
>
> Northern.CA ===--
> http://www.northern.ca
> Canada's Search Engine
>
> > -----Original Message-----
> > mmm... yeah... That's what I had before
> > (acutally I was using the alias split)...
> > it does NOT however preserve the areas
> > of white space.
> >
> > Instead the target of:
> > > > $wordsarr = ('This',' ','contans',' ','white',' ','space','
> > ','.')
> >
> > You get:
> > > > $wordsarr = ('This','','contans','','white','space','','.')
> >
> > which has totally destroyed the whitespace I'm trying to
> > keep intacted.
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
Northern.CA ===--
http://www.northern.ca
Canada's Search Engine
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]