Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function sum($a, $b) //Limited Argument
- {
- $c = $a + $b;
- echo "<p> Answer : ".$c;
- echo "<p>Total Argument : ".func_num_args();
- //Show Total Argument Pass in Function
- echo "<p>";
- echo "Total Argument Pass : ";
- print_r(func_get_args());
- // Show All Argument Value
- echo "<p>";
- var_dump(func_get_args());
- //var_dump(); Show Total Argument, Show All Argument Value With Data Type
- };
- function abc() //No Limit Of Argument
- {
- for($i=0; $i<func_num_args(); $i++)
- {
- echo "<p>- ".func_get_arg($i);
- }
- };
- ?>
- <html>
- <head>
- <title> Function </title>
- </head>
- <body>
- </body>
- </html>
- <?php
- echo "\"Hello\""; //Print Any Special Symbol Use -> \" <-
- sum(67,98,94);
- echo "<p>First Argument : ";
- abc(10, 20, 30);
- echo "<p>Second Argument : ";
- abc(40, 50, 60, 70);
- echo "<p>Third Argument : ";
- abc("Virajsinh", "9090909090", 9);
- ?>
Add Comment
Please, Sign In to add comment