Re: [PHP] help with explode()

2009-04-24 Thread Adam Williams
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

RES: [PHP] help with explode()

2009-04-24 Thread Jônatas Zechim
iams [mailto:awill...@mdah.state.ms.us] Enviada em: sexta-feira, 24 de abril de 2009 12:41 Para: PHP General list Assunto: [PHP] help with explode() 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

Re: [PHP] help with explode()

2009-04-24 Thread Jan G.B.
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

Re: [PHP] help with explode()

2009-04-24 Thread Adam Williams
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"]."

Re: [PHP] help with explode()

2009-04-24 Thread Jan G.B.
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

[PHP] help with explode()

2009-04-24 Thread 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 $termsarray = explode(" ", $_POST["term

RE: [PHP] help with explode.....

2003-07-24 Thread Joe Harman
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

Re: [PHP] help with explode.....

2003-07-24 Thread Binay Agarwal
> 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

[PHP] help with explode.....

2003-07-24 Thread Joe Harman
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 survey.. and