diff options
Diffstat (limited to 'php.html.markdown')
-rw-r--r-- | php.html.markdown | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/php.html.markdown b/php.html.markdown index 127e601b..cf9544b3 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -452,6 +452,16 @@ function parameters() { parameters('Hello', 'World'); // Hello | 0 - Hello | 1 - World | +// Since PHP 5.6 you can get a variable number of arguments +function variable($word, ...$list) { + echo $word . " || "; + foreach ($list as $item) { + echo $item . ' | '; + } +} + +variable("Separate", "Hello", "World") // Separate || Hello | World | + /******************************** * Includes */ |