When dealing with arrays in PHP form submissions, what are some potential pitfalls to be aware of?

One potential pitfall when dealing with arrays in PHP form submissions is not properly handling multiple values for the same input name. To solve this, you can use the `[]` syntax in the input name attribute to create an array of values for that input.

<form method="post">
    <input type="text" name="colors[]" value="red">
    <input type="text" name="colors[]" value="blue">
    <input type="text" name="colors[]" value="green">
    <button type="submit">Submit</button>
</form>

<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $colors = $_POST["colors"];
    foreach ($colors as $color) {
        echo $color . "<br>";
    }
}
?>