php 关联数组

<?php
$food['apple']="苹果";
$food['orange']="橘子";
$food['banana']="香蕉";

foreach ($food as $key => $value) {
# code...
echo $key;
echo $value;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Examples</title>
<meta name="description" content="">
<meta name="keywords" content="">
<link href="" rel="stylesheet">
</head>
<body>
    
</body>
</html>

猜你喜欢

转载自blog.csdn.net/liu709127859/article/details/80248832