<?php
/*
在PHP中,有三种数组类型:
1.索引数组:带有数组索引的数组
2.关联数组:带有指定键的数组
3.多维数组:包含一个或多个的数组
*/
echo "<h2>数组</h2>";
echo "<h3>直接赋值</h3>";
$arr_Value=array("num1"=>"a","num2"=>"b","num3"=>"c");
//遍历数组
foreach($arr_Value as $x=>$x_Value)
{
echo "Key={$x},Value={$x_Value}";
echo "<br/>";
}
echo "<h3>获得数组的长度 - count() 函数</h3>";
$length=count($arr_Value);
echo "数组arr_Value的长度为:{$length}<br/>";
echo $arr_Value['num1']."<br/>";
$age['Peter']="35";
$age['Ben']="37";
$age['Jom']="43";
echo "<pre>";
print_r($age);
echo "</pre>";
?>