How can PHP tags be used to distinguish between code and text in forum discussions?

To distinguish between code and text in forum discussions, PHP tags can be used to encapsulate the code snippets. By using PHP tags, the forum software will recognize the enclosed code as PHP code and display it accordingly, making it easier for users to differentiate between regular text and code snippets.

<?php
// Code snippet here
?>