What are the potential pitfalls of using print_r() to display array data in PHP?

Using print_r() to display array data in PHP can be problematic because it does not provide a visually appealing or easily readable output for large arrays. Instead, using the var_dump() function can provide a more detailed and structured view of the array data. Additionally, for better organization and readability, consider using HTML formatting to display the array data in a more user-friendly manner.

<?php
// Example array data
$array = array('apple', 'banana', 'cherry');

// Display array data using var_dump()
var_dump($array);
?>