using jquery’s .post i send do my php code an object that with var_dump i get this result:
array(6) {
[0]=>
array(1) {
["00176 "]=>
string(1) "2"
}
[1]=>
array(1) {
["00171 "]=>
string(1) "5"
}
[2]=>
array(1) {
["00173 "]=>
string(1) "1"
}
[3]=>
array(1) {
["00177 "]=>
string(1) "4"
}
[4]=>
array(1) {
["00183 "]=>
string(1) "2"
}
[5]=>
array(1) {
["00149 "]=>
string(1) "1"
}
}
how can i get values from this array? i would like to
foreach{
echo $key . '__ ' . $value //would give for [0]: '00176 __ 2'
}
how can i achieve that?
In case you are struggling with the nested structure of the array, you can flatten it first and then just do the
foreach:Another alternative is to use
each: