How can I use the array_walk function to apply a function to each element of an array in PHP? Example code: - Biz Tech

How can I use the array_walk function to apply a function to each element of an array in PHP? Example code:

Listen
$fruits = array("apple", "banana", "orange");

function print_fruit($fruit, $key) {
    echo "Key: " . $key . " - Value: " . $fruit . "<br>";
}

array_walk($fruits, "print_fruit");