I’ve got a html drop down <select> tag that I want to populate using the values from a POST. The variable name in question begins ‘P’ and is incremented by 1 each time, P1, P2, P3 etc etc.
How can I populate my drop down with this post data? I assume I need either a for or a for each loop in php?
Thanks
I would suggest naming your variable P[0], P[1], P[2], etc. on the form generating your list of variables. If you do, then in the form processing page you can do:
So if it looks like an array to PHP, you will get an array.