Judy Arrays

add a note add a note

User Contributed Notes 1 note

up
5
anis dot halayem at gmail dot com
8 years ago
Iterating through a Judy array with key as string and values of any type:

<?php
    $judy
= new Judy(Judy::STRING_TO_MIXED);
   
$judy["foo"]     = "bar";
   
$judy["veggie"]  = "carrot";
   
$judy["taste"]   = "sweet";

    if(
$judy->count() > 0) {
       
$key = $judy->first();
    do {
       
var_dump($judy[$key]);
    }while (!
is_null($key = $judy->next($key))) ;
    }
?>
To Top