[php] view plaincopyprint?
- foreach遍历数组
- <?php
- /*
- * 数组的遍历
- */
- $language = array("French",‘German‘,‘Russian‘,‘Chinese‘,‘Hindi‘,‘Quechu‘);
- foreach ($language as $key => $value) {
- echo $key.‘=‘.$value.‘<br />‘;
- }
- ?>
foreach遍历数组 <?php /* * 数组的遍历 */ $language = array("French",‘German‘,‘Russian‘,‘Chinese‘,‘Hindi‘,‘Quechu‘); foreach ($language as $key => $value) { echo $key.‘=‘.$value.‘<br />‘; } ?>
关联数组的遍历
[php] view plaincopyprint?
- <?php
- /*
- * 关联数组的遍历
- */
- $userList = array(‘UserName‘=>‘Lilia‘,‘Gender‘=>‘female‘,‘Age‘=>‘23‘,‘School‘=>‘Peking University‘);
- foreach ($userList as $key => $value)
- {
- echo $key.‘=‘.$value.‘<br />‘;
- }
- ?>
<?php /* * 关联数组的遍历 */ $userList = array(‘UserName‘=>‘Lilia‘,‘Gender‘=>‘female‘,‘Age‘=>‘23‘,‘School‘=>‘Peking University‘); foreach ($userList as $key => $value) { echo $key.‘=‘.$value.‘<br />‘; } ?>
- 猜你在找
- PHP SPL
- php数组
- PHP SPL笔记
- 算法设计手册第2版读书笔记 Springer - The Algorithm Design Manual 2ed Steven SSkiena 2008
- PHP SPL笔记
- JNI_编程技术__网文整理中
- PHP经典算法
时间: 2024-10-09 05:45:05