PHP code example of xushunbin / php-redis-bloom
1. Go to this page and download the library: Download xushunbin/php-redis-bloom library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
xushunbin / php-redis-bloom example snippets
composer
$bloom = new TestBloomFilter();
$phones = ['138000000000', '138000000001', '138000000002'];
try {
$bloom->add(...$phones);
} catch (Exception $e) {
var_dump($e->getMessage());
}
$ret1 = $bloom->has('138000000001');
var_dump($ret1); // true
$ret2 = $bloom->has('138000000009');
var_dump($ret2); // false