Mega Code Archive

 
Categories / Php / Functions
 

Build and then call a function

<?php   function helloworld (){     echo "Hello World!<br />";   }   helloworld();      function saysomething ($something){     echo $something . "<br />";   }   Saysomething ("Hello World!"); //This would output "Hello World!"   function addvalues ($firstvalue, $secondvalue){     return $firstvalue + $secondvalue;   }   $newvalue = addvalues (1,3);    echo $newvalue;  ?>