Jump to content

Initializing x amount of variables


jomak73

Recommended Posts

arrays work great for this.

 

$variable[0] = value

$variable[1] = value2

 

or also you can do this...

 

while($x=0; $x < 5; $x++)
{
        foreach($_POST as $v)
       {
               $variable[$x] = $v;
       }
}

 

 

That puts all of your $_POST variables into the array $variable.... Granted thats sort of repetitive, but you get the idea right?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.