Blogger Information
Blog 6
fans 0
comment 0
visits 5394
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
PHP 数组
PHP
Original
751 people have browsed it

在PHP中用 array()函数创建数组

在php中有三种类型的数组:

  1. 数值数组-带有数字ID健的数组,自动分配下标从0.1.2.3.。。。。$car=array=("Volvo","BMW","Toyopo");each "I like".array[0].","."array[1]"."。"; 这里的 . 号是拼接符。

   获取数组的长度-count()函数

  2.遍历数值数组。

遍历并且打印数值数组中的所有值,可以用到for循

实例

<?php
$text=array("Volvo","Bnm");
$Bex=count($text);

for($x=0;$x<Bexlength;$x++){
echo $text[$x];
echo "<br/>"
}
?>

运行实例 »

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




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