In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Garth Dahlstrom) wrote:
> > $sometext2split = "hello world witha lot ofwhitespaces!";
> > $myarray = preg_split ("/\s+/",$sometext2split);
> >
> > you should get
> > $myarray := ['hello', 'world', 'with', 'a', 'lot', 'of', 'whitespa
m: "Garth Dahlstrom" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, July 20, 2001 4:13 PM
Subject: Re: [PHP] Re: split on whitespace, preserving whitespace... (a
rephrase of the question)
> On Fri, 20 Jul 2001 15:34:48 +0200 "Stefan
t;
>
>
>
> [This contanswhite space .][This contanswhite space
> .]
>
>
> 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: [EMA
aces!"]
'cause I could spell check based on trimming the entry.
-Garth
Northern.CA ===--
http://www.northern.ca
Canada's Search Engine
>
> But remark: \t (tabs) will also count as whitespace, but not \n and
> \r. See
> docu for more informations
>
> Hope, it
On Fri, 20 Jul 2001 09:32:00 -0400 "Jack Dempsey" wrote:
>
> $text = "This contanswhite 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 "[$text][". implode('',$matches)."]";
here
in the text...
>
> best regards
> Stefan Rusterholz, [EMAIL PROTECTED]
>
>
> - Original Message -----
> From: "Stefan Rusterholz" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Friday, July 20, 2001 3:34 PM
> Subject
AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: split on whitespace, preserving whitespace...
Uuhmm, I'm sorry. I haven't read it throught to the end. The solution
ist a
bit different:
use preg_replace to replace multiple spaces with single spaces:
$sometext2split = preg_replace("|&q
TED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, July 20, 2001 3:34 PM
Subject: Re: [PHP] Re: split on whitespace, preserving whitespace...
> If you'r using PHP >4 use preg_split. (works also with php 3 >= 3.09)
> see http://www.php.net/manual/e
45 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: [PHP] Re: split on whitespace, preserving whitespace...
> try $wordarr = explode(" ", $string);
mmm... yeah... That's what I had before
(acutally I was using the alias split)...
it does NOT however preserve the areas
of whi
re informations
Hope, it helps
best regards
Stefan Rusterholz, [EMAIL PROTECTED]
- Original Message -
From: "Garth Dahlstrom" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, July 20, 2001 1:44 PM
Subject: [PHP] Re: split on whitespac
> try $wordarr = explode(" ", $string);
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:
> > $wo
11 matches
Mail list logo