K2hKeyQueue::read K2hKeyQueue Class

K2hKeyQueue::remove

Removes a key/value pair from the K2hKeyQueue

Description

 public bool K2hKeyQueue::remove ( int $count [, string $pass ] )

Removes a key/value pair from the K2hKeyQueue.

Parameters

Return Values

Returns true on success or false on failure.

Examples

<?php
$handle = k2hpx_open_mem();
$k2hkeyqueue = new K2hKeyQueue($handle, true, "test_queue_");
$k2hkeyqueue->push("test_queue_key1", "test_queue_value1");
$k2hkeyqueue->push("test_queue_key2", "test_queue_value2");
var_dump($k2hkeyqueue->count());
var_dump($k2hkeyqueue->remove(1));
var_dump($k2hkeyqueue->count());
unset($k2hkeyqueue);
k2hpx_close($handle);
?>

The above example will output:

int(2)
bool(true)
int(1)

See Also

K2hKeyQueue::read K2hKeyQueue Class