Re: More newbie problems -- this time regexp and split
| From: | Rob Tanner | Date: | Wed, 06 Sep 2000 02:16:36 +0000 |
| Subject: | Re: More newbie problems -- this time regexp and split | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-15419@lists.php.net to get a copy of this message | ||
Matt,
In another posting, Kenneth Lee talked about conflicts between mod_perl and php regexp engines when they are both compiled into apache. Is this a known problem about which there is more information? Like Kenneth, I have mod_perl-1.24 and php-3.0.16 together. Is my issue with split() a symptom of that problem, and do you know if upgrading to php-4.0.2 will resolve it? I don't particularly care whether its mod_perl or php that's the culprit. What I need is a way to make sure they can coexist.
Just a thought -- I've never tried it -- but can I have two separate servers sharing a common document tree?
Thanks for your thoughts.
-- Rob
--On 09/05/00 01:56:05 -0500 Matt McClanahan <cardinal@dodds.net> wrote:
On Mon, 4 Sep 2000, Rob Tanner wrote:The browser returns a bunch of email addresses (one or more) entered into a textarea block, separated by commas and/or whitespace. I try to split it and I get the first element repeated by itself up to limit-1, and the last element of the resulting array contains all the elements. To try and figure out what's wrong, I took a basic example from the WROX PHP book: $str = "one two three four"; $pat = " "; $array = split($pat, $str, 4); print "$array[0]<BR>\n"; print "$array[1]<BR>\n"; print "$array[2]<BR>\n"; print "$array[3]<BR>\n";I don't know what to tell you. That code block works fine for me in 4.0.1 and 3.0.5, so.. :) One thing I may suggest (For a different direction) is that when you're separating a string based on a single character, explode() will always be faster. Adjusting the above example.. $str = 'one two three four'; $array = explode(' ',$str,4); will accomplish the same task without the PHP engine having to call upon a regexp to separate the string. Not an answer to your question, but it may help. Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
_ _ _ _ _ _ _ _ _ _
/\_\_\_\_\ /\_\ /\_\_\_\_\_\
/\/_/_/_/_/ /\/_/ \/_/_/_/_/_/ QUIDQUID LATINE DICTUM SIT,
/\/_/__\/_/ __ /\/_/ /\/_/ PROFUNDUM VIDITUR
/\/_/_/_/_/ /\_\ /\/_/ /\/_/
/\/_/ \/_/ /\/_/_/\/_/ /\/_/ (Whatever is said in Latin
\/_/ \/_/ \/_/_/_/_/ \/_/ appears profound)
Rob Tanner
McMinnville, Oregon
rtanner@onlinemac.com