«^»
3.2. Outputting HTML from PHP

Instead of switching between HTML and PHP, it is possible to stay in PHP, using the PHP command echo (or print or printf) to output HTML.

So the PHP script given above can instead be written as:

0017: <?php
0018:    echo "<HTML><BODY>\n";
0019:    $numrows = 3;
0020:    for ($rownum = 0; $rownum<$numrows; $rownum++)
0021:    {
0022:       echo "<P>hello world</P>\n";
0023:    }
0024:    echo "</BODY></HTML>\n";
0025: ?>
Go to the script at: http://www.dur.ac.uk/barry.cornelius/papers/phpintro/code/hellothreeecho.php