Store random Form results within PHP variables

Hello Experts,
I have some Javascript code which will strip "var user_id" into individual values (these values are randomly generated prior to being stored within this variable ), and the values are then written as hidden input fields like below.

My question is how can i then get php to store this data into separate variables, for each posted input field when i dont know what the values are going to be, nor how many separate instances of the input fields will be generated.
var user_id= "1##2##3##4##5##6##7##8##9##10";
<form action="test.php" method="get" accept-charset="utf-8">
<input type="hidden" name="1" value="1">
<input type="hidden" name="2" value="2">
<input type="hidden" name="3" value="3">
<input type="hidden" name="4" value="4">
<input type="hidden" name="5" value="5">
<input type="hidden" name="6" value="6">
<input type="hidden" name="7" value="7">
<input type="hidden" name="8" value="8">
<input type="hidden" name="9" value="9">
<input type="hidden" name="10" value="10">

Open in new window

Who is Participating?
BrianGEFF719Connect With a Mentor Commented:
foreach($_GET as $key => $val)
 echo 'Variable: ' . $key . ' = ' . $val;

also, take a look at the fact that they are already in the get array:

agulaidAuthor Commented:
That works perfectly, thanks.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.