Notice: Use of undefined constant TAB - assumed 'TAB' in /var/www/php/htag.php on line 69

Indenting with hTag()

This demonstrates indenting text with the htag() function. To see the output, use the view source command. For most browsers, you can do this by right clicking in the document and selecting "v"iew "s"ource.

You can view the PHP program for this page and htag() through my Source Code Viewer.
Notice: Use of undefined constant TAB - assumed 'TAB' in /var/www/php/htag.php on line 69
TABTAB

TABTAB

htag() is a very simple program.htag('tag'); will open a tag and increase indent level.htag('-tag'); will create a self closing tag, eg. a meta tag.htag('/tag'); will close a tag and decrease indent and drop a note in the HTML if there is a tag mismatch.
Notice: Use of undefined constant TAB - assumed 'TAB' in /var/www/php/htag.php on line 69
TABTAB

TABTAB

The second parameter is the text for the attribute section of the tag. I turned this paragraph blue with a style attribute in the tag.
Notice: Use of undefined constant TAB - assumed 'TAB' in /var/www/php/htag.php on line 69
TABTAB

TABTAB

The $contents parameter is for the contents between an open and close tage. When contents is not null (as it is for the paragraph I am writing), htag() will create a self closing tag. If $contents is an array, the program will enclose each section of the array in tags.

TABTAB

In the next call, I will pass an array summarizing the last paragraphs.

TABTAB TABTAB

In this next example, I will produce a select list from a two dimensional array with the third element selected:
Notice: Use of undefined constant TAB - assumed 'TAB' in /var/www/php/htag.php on line 69
TABTAB


Notice: Use of undefined constant TAB - assumed 'TAB' in /var/www/php/htag.php on line 69
TAB

Notice: Use of undefined constant TAB - assumed 'TAB' in /var/www/php/htag.php on line 69

Notice: Use of undefined constant TAB - assumed 'TAB' in /var/www/php/htag.php on line 69