foreach是遍历数组的语句,标准用法是:foreach(数据类型 标识符 in 表达式)
e.g:
$person = array( "name1" => "peter", "name2" => "lisi");foreach ($person as $person_value) { echo "姓名:" . $person_value; echo "<br>";}
foreach是遍历数组的语句,标准用法是:foreach(数据类型 标识符 in 表达式)
e.g:
$person = array(
"name1" => "peter",
"name2" => "lisi"
);
foreach ($person as $person_value) {
echo "姓名:" . $person_value;
echo "<br>";
}