K2hKeyQueue::pop K2hKeyQueue Class K2hKeyQueue::read

K2hKeyQueue::push

Adds a key/value pair to the K2hKeyQueue

Description

 public bool K2hKeyQueue::push ( string $key , string $value [, string $pass [, int $expire ]] )

Adds a key/value pair to 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_");
var_dump($k2hkeyqueue->push("test_queue_key", "test_queue_value"));
var_dump($k2hkeyqueue->pop());
unset($k2hkeyqueue);
k2hpx_close($handle);
?>

The above example will output:

bool(true)
array(2) {
  [0]=>
  string(14) "test_queue_key"
  [1]=>
  string(16) "test_queue_value"
}

See Also

K2hKeyQueue::pop K2hKeyQueue Class K2hKeyQueue::read