Blogger Information
Blog 5
fans 0
comment 0
visits 2031
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
0805-1.给定一个数组$arr = [23,3,45,6,78,8,34],筛选其偶数成员组成新的数组返回,请封装函数。 2. 尝试实现简单的计算器功能,语言不限制
马勇*JackMa
Original
366 people have browsed it

数组$arr = [23,3,45,6,78,8,34],筛选其偶数成员组成新的数组返回

  1. $arr = [23,3,45,6,78,8,34];
  2. function arrFilter($data){
  3. $newArr = [];
  4. foreach($data as $val){
  5. if(!($val % 2)) array_push($newArr,$val);
  6. }
  7. return $newArr;
  8. }
  9. var_dump(arrFilter($arr));

尝试实现简单的计算器功能

周末补上

Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:在原来的作业上重新编辑就行了
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