What are some recommended methods for formatting and displaying PHP arrays for better readability?

When working with PHP arrays, it's important to format and display them in a way that is easy to read and understand. One recommended method is to use the `print_r()` function, which will display the array in a human-readable format. Another option is to use the `var_dump()` function, which provides more detailed information about the array's structure. Additionally, you can loop through the array and format the output using HTML or CSS to make it visually appealing.

// Example of using print_r() to display the array
$array = [1, 2, 3, 4, 5];
echo "<pre>";
print_r($array);
echo "</pre>";

// Example of using var_dump() to display the array
$array = ['name' => 'John', 'age' => 30, 'city' => 'New York'];
var_dump($array);

// Example of looping through the array and formatting the output
$array = ['apple', 'banana', 'orange'];
echo "<ul>";
foreach ($array as $item) {
    echo "<li>$item</li>";
}
echo "</ul>";