首页 > 代码库 > php -- 获取函数参数

php -- 获取函数参数

----- 015-parameter.php -----

 1 <!DOCTYPE html>
 2 <html>
 3 <head>
 4     <meta http-equiv="content-type" content="text/html; charset=utf-8">
 5     <title>获取函数参数</title>
 6 </head>
 7 <body>
 8 <h3>获取函数参数</h3>
 9 <pre>
10 <?php
11     function hello()
12     {
13         $prams = func_get_args();
14         foreach ($prams as $value) {
15             echo "Hello,", $value, "!\n";
16         }
17     }
18     hello("塞班", "黑莓", "联发科");
19 ?>
20 </pre>
21 </body>
22 </html>