php教程

Judy Arrays

User Contributed Notes

anis dot halayem at gmail dot com 28-Aug-2015 03:31
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))) ;
    }
?>

CopyRight © 2008-2022 verySource.Com All Rights reserved. 京ICP备17048824号-1 京公网安备:11010502034788