For example:
Copy codeThe Code is as follows:
Function say (){
Alert (arguments [0] + ':' + arguments [1]);
}
Say ('hanglor ', 'hanglor is a boy! ');
Result: fanglor is a boy!
--------------------------------------------------------------------------------
This is a bit similar to the func_get_args () function in php. It is also an array for obtaining function parameters.
Example (The following is the php code ):
Copy codeThe Code is as follows:
Function uses (){
$ Args = func_get_args ();
If (! Empty ($ args )){
Foreach ($ args as $ key => $ val ){
If (file_exists ($ val. '. php ')){
Include "{$ val}. php ";
} Else {
If (DEBUG ){
Echo "{$ val}. php does not exist! ";
}
}
}
}
}
// Re-encapsulate include
Uses ('config', 'db ');
Automatically load config. php and db. php. If it does not exist, it will display {__file __}. php does not exist.