提交表单时我没有在数组中获取数据。
$post['FirstName'] = $_POST['FirstName']; //not getting value in array from form
$newArray = array(); // initialize new array
$i = 0;
foreach ($post as $key => $value) {
$newArray[$i]['Attribute'] = $key;
$newArray[$i]['Value'] = $value;
$i++;
}
$data_string = json_encode($newArray);