What are some potential pitfalls when using the print_r() function in PHP?

One potential pitfall when using the print_r() function in PHP is that it can output a large amount of information, which may be overwhelming or difficult to read. To solve this issue, you can use the <pre> HTML tag to format the output in a more readable way.

&lt;?php
$data = array(&#039;foo&#039;, &#039;bar&#039;, &#039;baz&#039;);
echo &#039;&lt;pre&gt;&#039;;
print_r($data);
echo &#039;&lt;/pre&gt;&#039;;
?&gt;