How can PHP code be properly formatted and displayed in a forum post for better readability?

To properly format and display PHP code in a forum post for better readability, you can use code tags. Simply enclose your PHP code within [code] [/code] tags to preserve the formatting. This will help distinguish the code from the rest of the text and make it easier for others to read and understand.

<?php
// Your PHP code here
echo "Hello, World!";
?>