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