Is it best practice to use print_r for data output in PHP when it is intended for debugging purposes?

When using print_r for data output in PHP for debugging purposes, it is best practice to wrap it within <pre> tags to improve readability. This will format the output in a more organized and structured way, making it easier to analyze complex data structures. Additionally, using print_r inside a function like var_dump() or die() can help isolate and display specific data for debugging purposes.

echo &#039;&lt;pre&gt;&#039;;
print_r($data);
echo &#039;&lt;/pre&gt;&#039;;