How can PHP code be highlighted in a forum post without being parsed?

To highlight PHP code in a forum post without it being parsed, you can use HTML entities to encode the characters so that they are displayed as text rather than executed as code. This way, the PHP code will be visible to readers without being executed by the server.

<?php
echo "Hello, world!";
?>