Virajsinh

PhP_06

Feb 5th, 2018
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.92 KB | None | 0 0
  1. <?php
  2.  
  3.     function sum($a, $b) //Limited Argument
  4.     {
  5.         $c = $a + $b;
  6.         echo "<p> Answer : ".$c;
  7.        
  8.         echo "<p>Total Argument : ".func_num_args();
  9.         //Show Total Argument Pass in Function
  10.        
  11.         echo "<p>";
  12.         echo "Total Argument Pass : ";
  13.        
  14.         print_r(func_get_args());
  15.         // Show All Argument Value
  16.        
  17.         echo "<p>";
  18.         var_dump(func_get_args());
  19.         //var_dump(); Show Total Argument, Show All Argument Value With Data Type
  20.     };
  21.    
  22.     function abc() //No Limit Of Argument
  23.     {
  24.         for($i=0; $i<func_num_args(); $i++)
  25.         {
  26.             echo "<p>- ".func_get_arg($i);
  27.         }
  28.     };
  29. ?>
  30.  
  31. <html>
  32.  
  33. <head>
  34.     <title> Function </title>
  35. </head>
  36.  
  37. <body>
  38.  
  39. </body>
  40. </html>
  41.  
  42. <?php
  43.  
  44.     echo "\"Hello\""; //Print Any Special Symbol Use -> \" <-
  45.     sum(67,98,94);
  46.    
  47.     echo "<p>First Argument : ";
  48.     abc(10, 20, 30);
  49.    
  50.     echo "<p>Second Argument : ";
  51.     abc(40, 50, 60, 70);
  52.    
  53.     echo "<p>Third Argument : ";
  54.     abc("Virajsinh", "9090909090", 9);
  55.    
  56. ?>
Add Comment
Please, Sign In to add comment