What are some best practices for highlighting and formatting PHP code for better readability on a webpage?

When displaying PHP code on a webpage, it is important to format and highlight the code for better readability. One common way to achieve this is by using a syntax highlighting library or plugin, such as Prism.js or highlight.js. These tools can automatically detect and format PHP code within <pre> or <code> tags, making it easier for users to distinguish between code and text.

&lt;pre&gt;&lt;code class=&quot;language-php&quot;&gt;
&lt;?php
// Your PHP code here
echo &quot;Hello, World!&quot;;
?&gt;
&lt;/code&gt;&lt;/pre&gt;