array decleration

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tolkienarda
    Contributor
    • Dec 2006
    • 316

    array decleration

    hi all

    i need a variable length array and i was just wondering if the code it is the same as i learned in VB. here is the code i am trying.
    where $i is a counter
    $rowcount is the number of rows
    $arrayvariable[] is my variable lenght array
    [PHP]
    $i = 1;

    while ($i < $rowcount)
    {
    $arrayvariable[$i] = $row[imgdata];
    }
    [/PHP]

    thank you

    eric
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Yes you can use this. But declare the empty array before you use it.

    [php]
    $arrayvariable = array();
    [/php]

    Ronald :cool:

    Comment

    • tolkienarda
      Contributor
      • Dec 2006
      • 316

      #3
      super awesome thanks

      eric

      looks like you are almost up to 2k posts
      congrats

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        Thanks.

        Ronald

        Comment

        Working...