For clarification, I'm looking for execution speed.

In the example below, $cmd may be a 100 plus item array and I loop through
the code below for each $cmd.  So maybe I execute the code below 100 or more
times.

Thanks!
-Shawn

"Shawn McKenzie" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I will run some benchmarks (even though they may be flaky), but what would
> be the fastest execution?
>
> $search = array(
>             "<!-- [$cmd] -->",
>             "<!--[$cmd]-->",
>             "<!-- {".$cmd."} -->",
>             "<!--{".$cmd."}-->",
>             "{".$cmd."}",
>         );
> $replace = STARTPHP." $action ".ENDPHP;
> $tmpcontent = str_replace($search, $replace, $tmpcontent);
>
>
> Or, if I created one expression that handled all of the five $search items
> (since they are similar) and used preg_replace()?
>
> Thanks!
> -Shawn

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

Reply via email to