What is the correct syntax for passing an array to a function in PHP?

When passing an array to a function in PHP, you can simply declare the parameter as an array in the function definition. You don't need to specify the size of the array or its elements. The function will then be able to access and manipulate the array elements as needed.

// Define a function that takes an array as a parameter
function processArray($arr) {
    // Access and manipulate the array elements here
    foreach($arr as $item) {
        echo $item . " ";
    }
}

// Define an array
$array = [1, 2, 3, 4, 5];

// Call the function with the array as an argument
processArray($array);