What are potential pitfalls when using arrays to store form data in PHP?

One potential pitfall when using arrays to store form data in PHP is the risk of data manipulation or injection if the input is not properly sanitized. To mitigate this risk, always use PHP functions like `htmlspecialchars()` or `mysqli_real_escape_string()` to sanitize user input before storing it in an array.

// Example of sanitizing user input before storing it in an array
$data = [];
$data['name'] = isset($_POST['name']) ? htmlspecialchars($_POST['name']) : '';
$data['email'] = isset($_POST['email']) ? htmlspecialchars($_POST['email']) : '';
$data['message'] = isset($_POST['message']) ? htmlspecialchars($_POST['message']) : '';