Blogger Information
Blog 18
fans 0
comment 0
visits 13359
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
php函数的功能及使用-2019-9-28
无聊了的博客
Original
757 people have browsed it
实例
<?php

function product($a,$b,...$param)  
{
    return array_product($param);
}


echo product(3,1,5,7,8,4);
运行实例 »
点击 "运行实例" 按钮查看在线实例

总结:

1、...$args    php7+新增,表示剩余的参数数组

2、array_product()    php内置乘积函数

Correction status:qualified

Teacher's comments:剩余参数,也叫变长参数, php中有, js中也有, 有时可以解决大问题的.. 特别是框架中
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post