[PHP] 纯文本查看 复制代码 <?php
$cars=array("Volvo","BMW","Toyota");
$arrlength=count($cars);
for($x=0;$x<$arrlength;$x++)
{
echo $cars[$x];
echo "<br>";
}
?> Volvo
BMW
Toyota
[PHP] 纯文本查看 复制代码 <?php
$age=array("Peter"=>"35","Ben"=>"37","Joe"=>"43");
foreach($age as $x=>$x_value)
{
echo "Key=" . $x . ", Value=" . $x_value;
echo "<br>";
}
?> Key=Peter, Value=35
Key=Ben, Value=37
Key=Joe, Value=43 |