Javascript PHP to get the function parameter object code
- 2020-03-31 21:31:43
- OfStack
Such as:
Results: out of fanglor said: fanglor is a boy!
--------------------------------------------------------------------------------
This is a bit like the func_get_args() function in PHP, which is also an array of function arguments.
Example (here is the PHP code) :
Load config.php and db.php automatically. If not, {s} file}.php does not exist.
function say () {
alert (arguments[0]+' said :'+arguments[1]);
}
say ('fanglor','fanglor is a boy !');
Results: out of fanglor said: fanglor is a boy!
--------------------------------------------------------------------------------
This is a bit like the func_get_args() function in PHP, which is also an array of function arguments.
Example (here is the PHP code) :
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! ";
}
}
}
}
}
//Again, encapsulate include
uses ('config','db');
Load config.php and db.php automatically. If not, {s} file}.php does not exist.