You could send the items of data individually using AJAX if, for example, it is entered into a form and have PHP convert it into the array. Also, if the amount of data is too long you could encrypt it and store it as an encrypted cookie - so long as it doesn't affect usability if the cookie is deleted (You can pass cookies between javascript and PHP).
Joshua Henderson wrote:
It definitely does work (and it gives me a way to get the array from javascript to php without too problems as well!), but it isn't the most elegant solution.
Depends on you definition of "elegant solution", development speed or short fancy code. Your code looks fine to me anyway. Clean, readable and concise.
Neonlight