I tryed to display php code and html tag in a tuturial.
First simple option is,
as I have done below
There are nice modules which are useful for showing the code sample in post.
This module provides a simple text format (input filter) that handles and
tags so that users can post code without having to worry about manually escaping < and > characters with < and >
GeSHi Filter for syntax highlighting
The GeShi Filter module provides a filter for source code syntax highlighting for a wide range of languages.
Source code can be entered with for example
... or…. Starting from version 5.x-2.0 it is also possible to define your own generic and language specific tags (e.g.) or to work with square bracket style tags (e.g. ). Automatically adding line numbers is possible too with for example .