TokyoTyrant::fwmKeys
(PECL tokyo_tyrant >= 0.1.0)
TokyoTyrant::fwmKeys — بازگرداندن کلیدهای منطبق به جلو از پایگاه داده
Description
public array TokyoTyrant::fwmKeys
( string $prefix
, int $max_recs
)
بازگرداندن کلیدهای منطبق به جلو از پایگاه داده
Parameters
- prefix
-
پیشوند کلیدها
- max_recs
-
بیشترین رکوردهای بازگردانده شده
Return Values
بازگرداندن آرایه کلیدهای منطبق. مقدارها بازگردانده نمیشود
Examples
Example #1 مثال TokyoTyrant::fwmKeys()
<?php
$tt = new TokyoTyrant("localhost");
/* Create 20 macthing keys */
for ($i = 0; $i < 20; $i++) {
$tt->put("key_" . $i, "value_" . $i);
}
/* Create 20 non-macthing keys */
for ($i = 0; $i < 20; $i++) {
$tt->put("something_" . $i, "data_" . $i);
}
/* Get five matching keys */
var_dump($tt->fwmKeys("key_", 5));
?>
The above example will output something similar to:
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"
}
There are no user contributed notes for this page.
