日期:2014-05-17 浏览次数:20474 次
<?php for($i=0;$i<10;$i++) { ${'test'.$i} = "test{$i}"; apc_store("pos_{$i}",${'test'.$i}); } $results = new APCIterator('user', '/^.*$/'); while( !!($rs = $results->current()) ) { echo "key:{$rs['key']} -> value:{$rs['value']}<br/>"; $results->next(); } /**我这边测试的结果 key:pos_0 -> value:test0 key:pos_1 -> value:test1 key:pos_2 -> value:test2 key:pos_3 -> value:test3 key:pos_4 -> value:test4 key:pos_5 -> value:test5 key:pos_6 -> value:test6 key:pos_7 -> value:test7 key:pos_8 -> value:test8 key:pos_9 -> value:test9 */ ?>