$_POST Array from html form

php

Solution

Change

$info=$_POST['id[]'];

to

$info=$_POST['id'];

by adding `[]` to the end of your form field names, PHP will automatically convert these variables into arrays.

Problem

I am trying to send data from multiple checkboxes (id[]) and create an array "info" in php to allow me to run a script for each value (however the quantity of values may change each time) however first I am trying to display the content of each array value. I am not quite sure how to put my array populating line to save all the content to the array. HTML ``` echo("<input name='id[]' type='checkbox' value='".$shopnumb."'>"); ``` my hopeful processing code currently is - ``` $info=$_POST['id[]']; Echo(array_values($info)); ``` what do I need to do to make the content sent by post from the form checkboxes populate the array info any help is greatly appreciated edited for clarification.

Original source