* Thus wrote Richard Davey ([EMAIL PROTECTED]): > Hello Curt, > > Sunday, April 25, 2004, 4:28:37 PM, you wrote: > > CZ> Also instead of str_replace scanning the whole string 5 time to > CZ> replace the 5 items, its only scanned once, replacing up to five > CZ> things. > > My method *did* only scan the string once and str_replace is > definitely faster than preg_replace.
I was implying that internally php loops through each item in the array you pass and calls str_replace on the items. Thats why I added that it depends on the number of items and length of the string your searching. If you can take 50 element array down to 5, the overhead of preg wont matter as much. Curt -- "I used to think I was indecisive, but now I'm not so sure." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php