How can the output formatting be enhanced in PHP scripts, particularly when displaying arrays or lists of values?

When displaying arrays or lists of values in PHP scripts, the output formatting can be enhanced by using functions like `print_r()` or `var_dump()` to display the contents of the array in a more readable format. Additionally, looping through the array and formatting the output using HTML tags can also improve the presentation of the data.

// Example of using print_r() to display array values in a more readable format
$array = array("apple", "banana", "cherry");
echo "<pre>";
print_r($array);
echo "</pre>";

// Example of looping through an array and formatting the output using HTML tags
echo "<ul>";
foreach ($array as $value) {
    echo "<li>$value</li>";
}
echo "</ul>";