K2hIterator::key
Gets key of the current K2hIterator item
Description
public stringfalseK2hIterator::key ( void )
Gets the key in an array of k2hash keys.
Parameters
This function has no parameters.
Return Values
Returns the key.
Examples
- Example 1 - Gets a key 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->key());
unset($k2hiter);
?>
The above example will output:
string(5) "test2"
See Also
- K2hIterator::current - Gets value 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