K2hash::getAttrVersionInfos K2hash Class K2hash::getKeyQueue

K2hash::getIterator

Gets a K2hIterator object

Description

 public mixed K2hash::getIterator ( string $key )

Gets a K2hIterator object that points to the first element of keys. K2hIterator is a class to handle the array of k2hash keys.

Parameters

Return Values

Returns a K2hIterator object.

Examples

<?php
$k2hash = new K2hash();
$k2hash->openMem();
$k2hash->setValue("test1", "value1");
$k2hash->setValue("test2", "value2");
$k2hash->setValue("test3", "value3");
$iterator = $k2hash->getIterator();
$count = 0;
foreach($iterator as $val){
    $count++;
}
echo $count;
?>

The above example will output:

3

See Also

K2hash::getAttrVersionInfos K2hash Class K2hash::getKeyQueue