时间:2021-07-01 10:21:17 帮助过:17人阅读
代码如下:
$sports = array(
'football' => 'good',
'swimming' => 'very well',
'running' => 'not good');
foreach ($sports as $key => $value) {
echo $key.": ".$value."
";
}
?>
代码如下:
$sports = array(
'football' => 'good',
'swimming' => 'very well',
'running' => 'not good');
while (!!$elem = each($sports)) {
echo $elem['key'].": ".$elem['value']."
";
}
?>
代码如下:
$sports = array(
'football' => 'good',
'swimming' => 'very well',
'running' => 'not good');
while (!!list($key, $value) = each($sports)) {
echo $key.": ".$value."
";
}
?>
以上就介绍了白花蛇舌草的功效与作用及食用方法 php遍历数组的方法分享,包括了白花蛇舌草的功效与作用及食用方法方面的内容,希望对PHP教程有兴趣的朋友有所帮助。