K2hIterator::__construct K2hIterator Class K2hIterator::key

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

<?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::__construct K2hIterator Class K2hIterator::key