Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
13
Task/Variadic-function/PHP/variadic-function-1.php
Normal file
13
Task/Variadic-function/PHP/variadic-function-1.php
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
function printAll() {
|
||||
foreach (func_get_args() as $x) // first way
|
||||
echo "$x\n";
|
||||
|
||||
$numargs = func_num_args(); // second way
|
||||
for ($i = 0; $i < $numargs; $i++)
|
||||
echo func_get_arg($i), "\n";
|
||||
}
|
||||
printAll(4, 3, 5, 6, 4, 3);
|
||||
printAll(4, 3, 5);
|
||||
printAll("Rosetta", "Code", "Is", "Awesome!");
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue