Thank you Barand, but for some reason the solution did not work for me.
However...
I was able to fix my problem. With your help, I determined that I could not pass an array as a hidden variable without converting it to a string variable first.
To fix my problem, I first placed each element of the multi-dimensional array into a single dimension array with a delimiter. This was easy to do while I was still processing the array in another part of my script:
$items_listing[$i] = $order[$i][0].",".$order[$i][1].",".$order[$i][2];
After which, I imploded the new single-dimension array into a string and passed it in the form as a hidden variable:
$items_ordered = implode(',' , $items_listing);
.
.
.
print("<input type=\"hidden\" name=\"items_ordered\" value=\"".$items_ordered."\">\n");
On the page receiving the post variables, I pulled the array string and dumped it into a variable. Using loops, I ran through and created a new multi-dimensional array with the following code:
//Get string of items ordered
$items_ordered = $_POST['items_ordered'];
$i = 0;
//Process string
while (!empty($items_ordered)) {
for ($loop = 0; $loop <= 2; $loop++) {
//Get location of next comma
$comma_pos = strpos ($items_ordered, ",");
if ($comma_pos) {
//Dump first value in array element
$order[$i][$loop] = substr($items_ordered, 0, $comma_pos);
//Set items ordered string to newest value
$items_ordered = substr($items_ordered, $comma_pos + 1);
} else {
//Dump first value in array element
$order[$i][$loop] = $items_ordered;
//Set items ordered string to newest value
$items_ordered = "";
}
}
$i++;
}
I could then call/manipulate the array as normal.
This is the fix that worked for me. I hope it helps someone else out (or even me, again, in the future.)
🙂