Home >Backend Development >PHP Tutorial >PHP+Javascript javascript,php code to obtain function parameter object
For example:
Copy code The code is as follows:
function say () {
alert (arguments[0]+'say:'+arguments[1]);
}
say ('fanglor',' fanglor is a boy !');
Result: pop up fanglor said: fanglor is a boy !
-------------------------- -------------------------------------------------- ----
This is somewhat similar to the func_get_args() function in PHP, which also obtains an array of function parameters.
Example (the following is the php code):
Copy 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! ";
}
}
}
}
}
//Encapsulate include again
uses ('config','db');
Automatically load config.php and db .php, if it does not exist, it will display that {__file__}.php does not exist.
The above introduces PHP+Javascript javascript, PHP code for obtaining function parameter objects, including PHP+Javascript content, I hope you are interested in PHP tutorials Friends help.