PHP 函数返回值


PHP 函数返回值

<html>

   <head>
      <title>Writing PHP 函数 which returns value</title>
   </head>

   <body>

      <?php
         function addFunction($num1, $num2) {
            $sum = $num1 + $num2;
            return $sum;
         }
         $return_value = addFunction(10, 20);

         echo "Returned value from the function : $return_value";
      ?>

   </body>
</html>