How can using an array simplify the process of assigning values in PHP functions?

Using an array can simplify the process of assigning values in PHP functions by allowing you to pass multiple values as a single parameter instead of passing each value individually. This can make the code more organized and easier to manage, especially when dealing with a large number of parameters.

function assignValues($values) {
    foreach($values as $key => $value) {
        echo "Key: $key, Value: $value <br>";
    }
}

$values = array("name" => "John", "age" => 30, "city" => "New York");
assignValues($values);