Mega Code Archive

 
Categories / Php / Functions
 

Function with an Optional Argument

<html> <head> <title>Function with an Optional Argument</title> </head> <body> <?php function fontWrap( $txt, $size=3 ){    print "<font size=\"$size\">$txt</font>"; } fontWrap("call 1<br>",5); fontWrap("call 2<br>"); fontWrap("call 3<br>"); fontWrap("call 4<br>"); ?> </body> </html>