-
-
//学习each()函数的用法
- $prices=Array('Tries' => 100, 'Oil' => 10, 'Spank Plugs' => 4)
while($elements = each($prices)){
- echo $elements['key']; //echo $elements[0];
- echo " - ";
- echo $elements['value']; //echo $element[1];
- echo "
";
- }
-
复制代码
输出结果:
Tires-100
Oil-10
Spank Plugs-4
|