create a variable of a stringname

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

    create a variable of a stringname

    How can I do this:

    1) i have string $test="jeroen";
    2) a want to create $jeroen = 0;

    how can i do this?

    $'$test' = 0 ; ??????? (i don't think this wil work

    can any body help me???

    this is code where i need this:

    $fotoarray[0]="bedrijfsleide rfoto";
    $fotoarray[1]="logo";
    $fotoarray[2]="foto1";
    $fotoarray[3]="foto2";
    $fotoarray[4]="foto3";
    $fotoarray[5]="foto4";

    for($i=0;$i<6;$ i++)
    {
    if (isset($'$fotoa rray[$i]'))
    upload($'$fotoa rray[$i]',$naam,$fotoar ray[$i]);
    }

  • liam193

    #2
    Re: create a variable of a stringname

    something like $$test = 0; or ${$test} = 0; should work.

    See the following URL for details.:



    Comment

    Working...