Skip to content

Instantly share code, notes, and snippets.

@nurullahisik
Created March 1, 2019 07:53
Show Gist options
  • Save nurullahisik/85e3b05a5e6f7adc8b200c2763d1fa7b to your computer and use it in GitHub Desktop.
Save nurullahisik/85e3b05a5e6f7adc8b200c2763d1fa7b to your computer and use it in GitHub Desktop.
<?php
/* Example 2 */
// yes, the argument list can be empty
function foo() {
// returns an array of all passed arguments
$args = func_get_args();
foreach ($args[0] as $k => $v) {
echo $v."<br>";
}
}
foo(['a' => 1, 'b' => 2, 'c' => 3]);
/*
Result :
1
2
3
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment