How can you return an array from a function in PHP?

To return an array from a function in PHP, you can simply create an array within the function and return it using the `return` keyword. You can populate the array with values or manipulate it as needed within the function before returning it.

function getArray() {
    $myArray = [1, 2, 3, 4, 5];
    return $myArray;
}

// Call the function and store the returned array
$arrayResult = getArray();

// Output the returned array
print_r($arrayResult);