How to display HTML tags as Plain Text?

Method 1:

Replace < with &lt; and > with &gt;.

Example:

&lt;b&gt;Hello&lt;/b&gt;

Output:

<b>Hello</b>

Method 2:

Use PHP and its htmlspecialchars() function.

Example:

<?php

    echo htmlspecialchars('<p><b>Some HTML code</b></p>');

?>

Output:

<p><b>Some HTML code</b></p>