Esempio n. 1
0
//    array(2) {
//      [0]=> string(6) "user:1"
//      [1]=> string(6) "user:2"
//      [2]=> string(6) "user:3"
//      [3]=> string(6) "user:4"
//      [4]=> string(6) "user:5"
//    }
// Get users with tag <country:UK>
var_dump($MemcachedTags->getKeysByTag('country:UK'));
//    array(2) {
//      [0]=> string(6) "user:1"
//      [1]=> string(6) "user:2"
//      [2]=> string(6) "user:5"
//    }
// Get users with tag <city:Petersburg> OR <city:Murmansk>
var_dump($MemcachedTags->getKeysByTags(['city:Petersburg', 'city:Murmansk'], MemcachedTags::COMPILATION_OR));
//    array(2) {
//      [0]=> string(6) "user:3"
//      [1]=> string(6) "user:4"
//    }
// Get users with tags <country:UK> AND <sex:m>
var_dump($MemcachedTags->getKeysByTags(['country:UK', 'sex:m'], MemcachedTags::COMPILATION_AND));
//    array(3) {
//      [0]=> string(6) "user:1"
//      [1]=> string(6) "user:5"
//    }
// Get users with tag <country:UK> AND WITHOUT <sex:m>
var_dump($MemcachedTags->getKeysByTags(['country:UK', 'sex:m'], MemcachedTags::COMPILATION_XOR));
//    array(3) {
//      [0]=> string(6) "user:2"
//    }