functions

Post

Posts tagged as "functions"

2 comments   |   PHP, Useful
Passing variable number of arguments to a PHP function

Passing variable number of arguments to a PHP function

function test () { $args = func_get_args(); //get all arguments into array foreach($args as $num=>$val) { echo '<p>'.$val.'</p>'; //print argument } } The same useful functions: func_num_args() -get num of passing arguments func_get_arg(n) - get argument by it number