Since you can’t really pass pointers or references to arrays and you can’t return anything other than integers, here’s how to implement push, pop, shift, and unshift in a bash shell script. I don’t know if this already exists in bash, but I couldn’t find it and I needed a data structure in a hurry.
Now when go.php loads, you can check to see if there’s anything in the post_arr, and if there is, cycle through the array and store all the elements. I couldn’t find a working example of this just by googling. It seemed like tons of people would ask for this, but any responses on forums would be, “well what are you really trying to do”. So here it is.