i have a html form in which i use array like this (name="courts[]"). when it send data to php file i use foreeach loop to create multidimensional array for inserting records in mysql. In php file i write foreeach loop to iterate like this
$data = array();
$i = 0;
foreach ($court_name as $result)
{
$data[] = array(
'court_name' => $result[0]
);
$i++;
}
it display result this
Array
(
[0] => Array
(
[court_name] => P
)
[1] => Array
(
[court_name] => S
)
)
instead of this
Array
(
[0] => Array
(
[court_name] => Punjab
)
[1] => Array
(
[court_name] => Sindh
)
)