What is the purpose of using <pre> tags in PHP code and how does it affect the output?

Using <pre> tags in PHP code allows for the output to be displayed in a preformatted manner, preserving any white spaces, line breaks, and tabs. This can be useful when displaying code snippets or any text that needs to maintain its original formatting.

&lt;?php
echo &quot;&lt;pre&gt;&quot;;
// Your PHP code here
echo &quot;&lt;/pre&gt;&quot;;
?&gt;