Home > Backend Development > PHP Tutorial > PHP+Javascript javascript,php code to obtain function parameter object

PHP+Javascript javascript,php code to obtain function parameter object

PHP中文网
Release: 2016-07-29 08:44:21
Original
946 people have browsed it

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.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Latest Issues
Setting session variables using JavaScript in PHP
From 1970-01-01 08:00:00
0
0
0
Set session variables in PHP using javascript
From 1970-01-01 08:00:00
0
0
0
How to call PHP function through JavaScript?
From 1970-01-01 08:00:00
0
0
0
How to pass PHP variables and data to JavaScript
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template