Jan G.B. wrote:
Yes, preg_match_all returns all matches and the subpattern matches
(the "stuff" inside the brakes)
You can ommit stop it by using (?:) instead of ()..
So: preg_match_all('/(?:[a-z]+|"[a-z ]+")/i', $_POST["terms"], $termsarray)
You might want to check out the regular expression
2009/4/24 Adam Williams :
>
>
> Jan G.B. wrote:
>>
>> You could try it with regular expression matching..
>> for example:
>> > preg_match_all('/([a-z]+|"[a-z ]+")/i', $searchstring, $resultarray);
>> ?>
>>
>>
>> Regards
>>
>
> Thanks. That seems to create 2 duplicate arrays, though. Can it be
Jan G.B. wrote:
You could try it with regular expression matching..
for example:
Regards
Thanks. That seems to create 2 duplicate arrays, though. Can it be
narrowed down to just array [0]?
preg_match_all('/([a-z]+|"[a-z ]+")/i', $_POST["terms"], $termsarray);
echo $_POST["terms"]."
2009/4/24 Adam Williams :
> I have a form where users submit search terms and it explodes the terms into
> an array based upon spaces. But, how can I have explode() keep words in
> quotation marks together? For example, if someone enters on the form:
>
> John Jill "Judy Smith"
>
> and I run $term
SO COOL...
Thanks too all
-Original Message-
From: Binay Agarwal [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 1:48 PM
To: Joe Harman
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] help with explode.
> Okay... this probably isn't that hard to do... but I am just
> Okay... this probably isn't that hard to do... but I am just not sure to
> do it... so i will ask you guys... i amsure someone is going to have a
> one liner for me here!
>
> I am making a survey/poll builder everything is dynamic... there is an
> admin section where the user can make the new su
6 matches
Mail list logo