Jump to content

filling array with both keys and values in loop


stijn0713

Recommended Posts

i have 2 arrays, say:

 

$c = array (7500, 8200, 4000)

and

$variables = (x1, x2, x3 etc....)

 

now, i want to map these arrays so that the coëfficients are the keys, and the variables values in a mapper array.

 

I tried this:

 

$mapper = array();

foreach ($c as $value){

$b = 1;

$mapper($value => $variabelen[$b]);

$b++;

}

 

but apparently that doesnt work.

 

Any help would be appreciated!

 

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.