Javascript and php code for getting function parameter objects. For more information, see. For example:
The 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 ):
The 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.