Using this
var data=$("#form").serializeArray();
output following array using
print_r($data);
in php results to
$data=Array(
[0] => stdClass Object
(
[name] => location
[value] =>lko
)
[1] => stdClass Object
(
[name] => street_number
[value] => 425
)
)
into the following array
Array(
[location]=>lko
[street_number]=>425)
So far ,I have tried the following
foreach ($data as $key) {
echo $POST[$key['name']]=$key['value'];
}
result into following error
Fatal error: Caot use object of type stdClass as array in on line 1237
