pushing elementson array with indices

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gecke Rün

    pushing elementson array with indices

    Hi all,

    I try to push elements on an array but without succes. I have a for loop and
    need to do something like this array_push ($doelpunten, "$myrow[0]" =>
    "$myrowDoelpunt en[0]"); where myrow[0] is de indice and $myrowDoelpunte n[0]
    the value. $doelpunten is the array Someone can help me out?

    Thanks
    Stijn


  • Daniel Tryba

    #2
    Re: pushing elementson array with indices

    "Gecke R?n" <mepisto@hotmai l.com> wrote:[color=blue]
    > I try to push elements on an array but without succes. I have a for loop and
    > need to do something like this array_push ($doelpunten, "$myrow[0]" =>
    > "$myrowDoelpunt en[0]"); where myrow[0] is de indice and $myrowDoelpunte n[0]
    > the value. $doelpunten is the array Someone can help me out?[/color]

    Unless you are searching for:
    $doelpunten[{$myrow[0]}]=$myrowDoelpunt en[0];
    give us an example of what the before and after looks like!

    --

    Daniel Tryba

    Comment

    • Gecke Rün

      #3
      Re: pushing elementson array with indices


      "Daniel Tryba" <news_comp.lang .php@canopus.nl > wrote in message
      news:cjjruh$k61 $1@news.tue.nl. ..[color=blue]
      > "Gecke R?n" <mepisto@hotmai l.com> wrote:[color=green]
      >> I try to push elements on an array but without succes. I have a for loop
      >> and
      >> need to do something like this array_push ($doelpunten, "$myrow[0]" =>
      >> "$myrowDoelpunt en[0]"); where myrow[0] is de indice and
      >> $myrowDoelpunte n[0]
      >> the value. $doelpunten is the array Someone can help me out?[/color]
      >
      > Unless you are searching for:
      > $doelpunten[{$myrow[0]}]=$myrowDoelpunt en[0];
      > give us an example of what the before and after looks like!
      >
      > --
      >
      > Daniel Tryba
      >[/color]

      That did the job. Thanks


      Comment

      Working...