i am trying to create a function to create a set of variables that are arrays like so
function breakDownPOSTArray($count, $fields) {
$repeat = 1;
$num = 0;
while ($repeat <= $count) {
$a = "array" . $repeat;
$$a = array_slice($_POST, $num, $fields);
$repeat ++;
$num += 4;
}
i want to be able to use these variables outside of the function. as it stands i am declaring the variables outside the function and pulling them in globally but that feels like it is defeating the object and i am repeating myself too much.
is there a better way to achive what i want with out declearing the variables outside the function?