0

I'm trying to get a list of the key-value stored in APCu.

I have tried apcu_cache_info(), but it doesn't return the value and returns a lot of additional info that I don't need. I don't know if APCUIterator can be the solution, I'm trying to understand the syntax... I have tried the documentation example but nothing happens:

foreach (new APCUIterator('/^counter\./') as $counter) {
    echo "$counter[key]: $counter[value]\n";
    apc_dec($counter['key'], $counter['value']);
}

Some hint?

Thanks for your time.

Héctor
  • 399
  • 3
  • 16

1 Answers1

0

Try this:

foreach (new APCUIterator('/^\.*/') as $counter)
{
    echo "$counter[key] ---> $counter[value] \n";
}
karrtojal
  • 796
  • 7
  • 16