How can one improve the readability of array outputs in PHP without using the "pre" tag?

When outputting arrays in PHP without using the "pre" tag, the output may appear as a single line of text, making it difficult to read and understand the array structure. To improve readability, you can use the "print_r" function in combination with the "nl2br" function to insert line breaks in the output. This will format the array output in a more organized and readable way.

$array = [1, 2, 3, 4, 5];
echo nl2br(print_r($array, true));