Yes because doing a hash lookup is much faster than looping + str_replace. You increase memory but that is the tradeoff.

Chris Goffinet
[EMAIL PROTECTED]



On Nov 2, 2007, at 9:24 PM, mike wrote:

On 11/2/07, Chris Goffinet <[EMAIL PROTECTED]> wrote:
Maybe I am missing something here but you dont like having to do
str_replace...I agree its stupid.

Why not add:
               $cache_keys_prefix[$prefix.$key] = $prefix.$key;
              $cache_keys[$prefix.$key] = $key;

$need_array = array_diff_key($cache_keys_prefix, $cache_array);

foreach( $need_array as $key => $value)
{
 $query_keys .= "," . $cache_keys[$key];
}
$query_keys[0] = ""; // remove first comma

So you're basically telling me to setup two separate arrays at first,
if I understand this right?

Reply via email to