K2hIterator::rewind
Rewinds the internal array pointer of k2hash keys
Description
public void K2hIterator::rewind ( void )
Rewinds the internal array pointer of k2hash keys.
Parameters
This function has no parameters.
Return Values
No value is returned.
Examples
- Example 1 - Rewinds the internal array pointer of k2hash keys
<?php
$handle = k2hpx_open_mem();
k2hpx_set_value($handle, "test1", "value1");
k2hpx_set_value($handle, "test2", "value2");
$k2hiter = new K2hIterator($handle);
$k2hiter->next();
$k2hiter->rewind();
var_dump($k2hiter->key());
unset($k2hiter);
?>
The above example will output:
string(5) "test1"
See Also
- K2hIterator::current - Gets value of the current K2hIterator item
- K2hIterator::key - Gets key of the current K2hIterator item
- K2hIterator::next - Advances the internal array pointer of k2hash keys