Write to Dynamic arrays
Posted: Thu Jan 04, 2007 10:37 am
I need to be able to write to certain arrays depending on the number contained in var.
For instance, $num could contain the numbers 1 though 99. If the number is 1 then I want to write some data to $arr1, if it is 2 then I want to write to $arr2, and so on. Because the numbers can range from 1 to 99 I wish not to do a HUGE if else block (or even case).
Is there a way to dynamically decide which array to write to?
For instance, $num could contain the numbers 1 though 99. If the number is 1 then I want to write some data to $arr1, if it is 2 then I want to write to $arr2, and so on. Because the numbers can range from 1 to 99 I wish not to do a HUGE if else block (or even case).
Is there a way to dynamically decide which array to write to?