Construct Parameter from Array
Posted: Fri Aug 20, 2010 3:56 am
Hi Chaps,
I have a while loop which produces a couple of variables:
Basically what I need to do is contruct a parameter made up of all the $NVP variables.
I've a feeling that I would need to add each variable to an array and then use a foreach statement, but I'm not 100% sure.
I'd be interested in the correct way to go about this, any comments welcome!
I have a while loop which produces a couple of variables:
Code: Select all
do {
$L_NAME.$i = 'Item 1';
$L_NUMBER.$i = '0001';
$L_QTY.$i = '1';
$L_AMT.$i = 10.50;
$NVP.$i = "L_NAME.$i.= .$L_NAME.$i.&L_NUMBER.$i. = .$L_NUMBER.$i.&";
} while($i == $items);I've a feeling that I would need to add each variable to an array and then use a foreach statement, but I'm not 100% sure.
I'd be interested in the correct way to go about this, any comments welcome!