Can arguments be passed in a different way within a PHP function?

In PHP, arguments can be passed in a different way within a function by using an array as a parameter instead of listing individual arguments. This can be useful when you have a variable number of arguments or want to pass multiple values easily. To implement this, you can define the function with an array parameter and then access the values within the function by using array indexing.

function exampleFunction($args) {
    // Access arguments using array indexing
    $arg1 = $args[0];
    $arg2 = $args[1];

    // Rest of the function logic
}

// Call the function with arguments passed in an array
exampleFunction(['value1', 'value2']);