Blogger Information
Blog 20
fans 0
comment 0
visits 12333
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
返回数组中所有的值并给其建立从0开始递增的数字索引
缘亦
Original
510 people have browsed it

主要是用到array_values()函数

array_values() 返回数组中所有的值并给其建立数字索引。

实例

<?php
$arr = [4 => 10, 1 => 22, 9 => 55, 0 => 255];
echo '<pre>索引处理前<br>';
print_r( $arr );
echo '<hr>索引处理后<br>';
print_r( array_values( $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