dcsimg

Displaying Portions of Raw HTML Code Page 6

By ServerWatch Staff (Send Email)
Posted Sep 7, 2000


Another new feature to PHP4 is a new syntax is modeled after Perl's "here printing." It is possible to display complete portions of HTML code by flanking them with either a print or echo instruction and an end label. Unlike Perl, the operator used is not a double less than sign (<<), but a triple less than sign (<<<) so as to distinguish it from the binary shift operator. For example:

<?php


$version = phpversion();
$valstr = "Example of HerePrinting\n";

echo "<hr><br>/n";

print <<< mylabel

<h4>PHP's New Features</h4>
<ul>
<li>ISAPI support
<li>COM support on Win32
<li>Java and servlets support
</ul>

<p>$valstr <br>Tested on PHP version $version</p>

mylabel;

echo "<hr><br>/n";
?>




Comment and Contribute

Your name/nickname

Your email

(Maximum characters: 1200). You have characters left.