Tuesday 20 March 2012

FUNCTION WITH ARGUMENTS

<html>
<body>
<?php
 function fontWrap($txt, $size )
 {
 print "<font size=\"$size\" face=\"Helvetica,Arial,Sans-Serif\">$txt</font>";
 }
fontWrap("A heading <br>",5);
fontWrap("some body text <br>",3);
fontWrap("some more body text <BR>",3);
fontWrap("YET MORE BODY TEXT <BR>",4);
 ?>
</body>
</html>

OUTPUT
A heading some body text some more body text YET MORE BODY TEXT 

No comments:

Post a Comment