<?php
//索引数组
$str=["亢龙有悔" ,"飞龙在天","龙兴日安心","县龙在天","潜龙勿用"];
//关联数组
$guanlian = ["name"=>"郭靖","position"=>"金岛驸马"."skill'=>'降龙第八章"];
$swean = [];
$swean["name"]="杨过";
$swean["position"]="daxia";
$swean["skill"]="xiaohunzhan";
echo $str[4];
echo "<hr>";
//for 循环
$res1="";
for ($i=0;$i<count($str);$i++){
$res1 .=$str[$i] .",";
}
echo $res1,"<hr>";
echo rtrim($res1,",");
echo "<hr>";
//while
$res2="";
$i=0;
while ($i<count($str)){
$res2 .=$str[$i] ."*";
$i++;
}
echo $res2,"<hr>";
echo rtrim($res2,"*");
echo "<hr>";
//foeeach
foreach ($guanlian as $key=>$value);
{
echo $key, "=>" ,$value,"<hr>";
}