Tuesday, 20 March 2012

FUNCTION WITH ARGUMENTS

<html>
 <head>
 <title>Listing 6.4</title>
 </head>
 <body>
 <?php
 function addNums( $firstnum, $secondnum)
 {
 $result = $firstnum + $secondnum ;
 return $result;
 }
 print addNums(3,5);
 // will print "8"
 ?>
 </body>
 </html>
OUTPUT
8

No comments:

Post a Comment