Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

Function with an Optional Argument

Tue Oct 28, 2008 1:55 pm

Code:
<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>




Post a reply
  Related Posts  to : Function with an Optional Argument
 Passing an Argument to a Function by Value     -  
 Invalid Argument error in IE7     -  
 argument type of a program's main() method     -  
 invalid argument on IE with script to center objects     -  
 php function     -  
 Using the array_slice () Function     -  
 Nested function     -  
 array_key_exists function use     -  
 Using include function     -  
 Function Overloading     -  

Topic Tags

PHP Functions