©
Ce document utilise Manuel du site Web PHP chinois Libérer
(PECL tokyo_tyrant >= 0.1.0)
TokyoTyrant::fwmKeys — Returns the forward matching keys
$prefix
, int $max_recs
)Returns the forward matching keys from the database
prefix
Prefix of the keys
max_recs
Maximum records to return
Returns an array of matching keys. The values are not returned
Example #1 TokyoTyrant::fwmKeys() example
<?php
$tt = new TokyoTyrant ( "localhost" );
for ( $i = 0 ; $i < 20 ; $i ++) {
$tt -> put ( "key_" . $i , "value_" . $i );
}
for ( $i = 0 ; $i < 20 ; $i ++) {
$tt -> put ( "something_" . $i , "data_" . $i );
}
var_dump ( $tt -> fwmKeys ( "key_" , 5 ));
?>
以上例程的输出类似于:
array(5) { [0]=> string(5) "key_5" [1]=> string(6) "key_14" [2]=> string(5) "key_6" [3]=> string(6) "key_15" [4]=> string(5) "key_7" }