[PHP] Re: Arrays and Regs

2002-07-19 Thread Martin Clifford

Firstly, many thanks to Richard and Dan...

A quick test script in PHP would have been faster than asking... :-)

It was just one of those questions that I had burning in my mind at the time, and 
since I don't have access to PHP at work (As if the Government would allow that!), I 
had to ask :o)

And to Dan:  I would love to change the line margins of my email client, but 
unfortunately Novell Groupwise sucks, and the government will not, without exception, 
allow customization of any software, whatsoever.  So I'm stuck with it.

Thanks again guys!

Martin


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Arrays and Regs

2002-07-18 Thread Richard Lynch

Just a performance question, if anyone knows for sure.  Within a large 
array, would using numerical indices be quicker than associative?  I'm 
talking about a *noticeable* difference in performance, here.

Almost for sure, nope.

Run a test for yourself.

Also, on Regular Expression replacements:

$text = eregi_replace(([abc]+), span style=\color: red\\\1/span, $text);

Would this replace any occurences of the pattern with the same pattern 
match in red text?  I'm not sure exactly how the \\1, \\2, etc. works.  So, does:

Yes, for those browsers that understand the span tag.
A quick test script in PHP would have been faster than asking... :-)

$text = eregi_replace((a)(b)(c), \\1, $text);

Does this output only the 'a'?  I find this confusing for some reason, 
hehe.  Any help would be great!

Yes.  If you had \\2 and \\3 somewhere, they'd be 'b' and 'c' respectively.
Again a quick test script in PHP would have been faster...

-- 
Like Music?  http://l-i-e.com/artists.htm


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php