This is the site to help you

Variable Length argument Function

by Your Name 0 comments

Tag


Share this post:
Design Float
StumbleUpon
Reddit

Variable length Argument Function
func_num_args()

Returns the number of arguments passed to the function

Syntax : int func_num_args ( void )
Returns the number of arguments passed into the current user-defined function. func_num_args() will generate a warning if called from outside of a user-defined function.



func_get_arg()
-- Return an item from the argument list

Syntax : mixed func_get_arg ( int arg_num)

Returns the argument which is at the arg_num'th offset into a user-defined function's argument list. Function arguments are counted starting from zero. func_get_arg() will generate a warning if called from outside of a function definition.
If arg_num is greater than the number of arguments actually passed, a warning will be generated and func_get_arg() will return FALSE.

= 2) { echo "Second argument is: " . func_get_arg(1) . "
\n"; }} foo (1, 2, 3);?>

func_get_args()

-- Returns an array comprising a function's argument list

Syntax : array func_get_args ( void )
Returns an array in which each element is the corresponding member of the current user-defined function's argument list. func_get_args() will generate a warning if called from outside of a function definition

= 2) { echo "Second argument is: " . func_get_arg(1) . "
\n"; } $arg_list = func_get_args(); for ($i = 0; $i < $numargs; $i++) { echo "Argument $i is: " . $arg_list[$i] . "
\n"; }} foo(1, 2, 3);?>

Comments 0 comments

Feeds rss Hello, I am professor in Cushah college of management.

Harshit Mehta
A short description here
montu7777@gmail.com

Subscribe feeds via e-mail
Subscribe in your preferred RSS reader

Subscribe feeds rss Recent Entries

Advertise on this site Sponsored links

Categories

Sponsored Links

My Photos on flickr

Subscribe feeds rss Recent Comments

Technorati

Technorati
My authority on technorati
Add this blog to your faves