Array Associatif

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • G Roydor

    #1

    Array Associatif

    Comment connaitre les Clés d'un array associatif

    tb["un"]="un tout seul";
    tb["deux"]="un + un";

    comment récupérer le couple (key value) comme dans PHP

    Merci
    G.Roydor

  • Ivo

    #2
    Re: Array Associatif

    "G Roydor" <guy.roydor@nos pamlaposte.net> wrote in message
    news:4035D514.1 070808@nospamla poste.net...[color=blue]
    > Comment connaitre les Clés d'un array associatif
    >
    > tb["un"]="un tout seul";
    > tb["deux"]="un + un";
    >
    > comment récupérer le couple (key value) comme dans PHP[/color]

    //warning: only do it this way if you know tb isn't very long!!

    for (i in tb) alert( i + ' ' + tb[i]);

    otherwise:

    for (i in tb) if( !confirm( i + ' ' + tb[i]) ) break;

    HTH
    Ivo


    Comment

    Working...