Use the echo or print commands as you normally would to print the text string . . . except in this case, your text string happens to be HTML code. The main catch is wherever you normally use quotes (") in HTML, you need to use backslash and quotes (\").
Another common character I use is the new line character (\n). It makes the resulting HTML a little more readable.
Good luck.