Blogger Information
Blog 250
fans 3
comment 0
visits 321684
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
实例:如何用for()循环遍历一个索引数组
梁凯达的博客
Original
704 people have browsed it

 利用for循环的方法进行一个索引数组的遍历,需要用到数组的直接赋值法

例:

    $arr[]= $i;

以上方式是,$i赋值到$arr这个数组当中。

实例

<?php
	for($i=0;$i<=20;$i++){
	 	$arr[]=$i;
	}
	var_dump($arr);

运行实例 »

点击 "运行实例" 按钮查看在线实例

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