What are the best practices for handling empty fields in a PHP array?

When dealing with empty fields in a PHP array, it is important to check for empty values before performing any operations on them to avoid errors or unexpected behavior. One way to handle empty fields is to use the `empty()` function to check if a value is empty or not before accessing it in the array.

// Example of handling empty fields in a PHP array
$data = [
    'name' => 'John Doe',
    'age' => '',
    'email' => 'john.doe@example.com',
];

foreach ($data as $key => $value) {
    if (!empty($value)) {
        echo $key . ': ' . $value . '<br>';
    } else {
        echo $key . ': N/A <br>';
    }
}