Pass the value by reference to modify the original array:
foreach ($posted_product_details as $column => & $info) {
$name = $info['name'];
$data = $info['data'];
$info['data'] = array_filter($data);
}
This will correctly filter the data
part of your array. However, if you need to filter out deeper elements, you'll have to use a recursive function, such as this one.