Blogger Information
Blog 14
fans 0
comment 0
visits 8762
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
如何使用array_values()函数
于星辉
Original
524 people have browsed it
  1. <?php
  2. $arr = [4=>10,1=>22,9=>55,0=>255];
  3. $newArr= array_values($arr);
  4. echo '<pre>';
  5. var_dump($newArr);
  6. echo '<hr>';
  7. //使用foreach循环
  8. $newArr = [];
  9. foreach($arr as $k=>$v){
  10. array_push($newArr,$v);
  11. }
  12. echo '<pre>';
  13. var_dump($newArr);
  14. ?>
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