当前位置:网站首页>PHP uses foreach to get a value in a two-dimensional associative array (with instances)
PHP uses foreach to get a value in a two-dimensional associative array (with instances)
2022-07-03 08:46:00 【The luckier~】
PHP use foreach To get a value in the associative array ( There are examples )
** Association array definition :** The subscript of an associative array is a mixture of numeric values and strings . If in an array , One key name is not a number , Then this array is called associative array .
Here are some Inline code slice
.
<?php
// Define a 2D associative array
$arr = array(
array('name'=>'zhangsan','chinese'=>'99','math'=>'65'),
array('name'=>'lisi','chinese'=>'61','math'=>'85')
);
foreach ($arr as $k=>$v){
echo $v['name'];
echo "<br>";
}
?>
边栏推荐
- Find the intersection of line segments
- [rust notes] 06 package and module
- 了解小程序的笔记 2022/7/3
- Unity Editor Extension - event handling
- MySQL index types B-tree and hash
- 【Rust笔记】02-所有权
- [concurrent programming] consistency hash
- Unity editor expansion - scrolling list
- Introduction to hexadecimal coding
- [concurrent programming] atomic operation CAS
猜你喜欢
matlab神經網絡所有傳遞函數(激活函數)公式詳解
第一个Servlet
分配异常的servlet
基于SSM的校园失物招领平台,源码,数据库脚本,项目导入运行视频教程,论文撰写教程
MySQL 8
Visual Studio (VS) shortcut keys
Explain sizeof, strlen, pointer, array and other combination questions in detail
二进制转十进制,十进制转二进制
[set theory] order relation (total order relation | total order set | total order relation example | quasi order relation | quasi order relation theorem | bifurcation | quasi linear order relation | q
100 GIS practical application cases (78) - Multi compliance database design and data warehousing
随机推荐
Solution détaillée de toutes les formules de fonction de transfert (fonction d'activation) du réseau neuronal MATLAB
Unity editor expansion - the framework and context of unity imgui
【Rust笔记】05-错误处理
ES6 promise learning notes
UE4 source code reading_ Bone model and animation system_ Animation process
第一个Servlet
单调栈-42. 接雨水
Installation of PHP FPM software +openresty cache construction
[concurrent programming] Table hopping and blocking queue
[rust notes] 06 package and module
[concurrent programming] thread foundation and sharing between threads
【Rust笔记】06-包和模块
注解简化配置与启动时加载
Mxone Pro adaptive 2.0 film and television template watermelon video theme apple cmsv10 template
MySQL three logs
UE4 plug in development
Dom4j遍历和更新XML
Unity editor expansion - window, sub window, menu, right-click menu (context menu)
Unity editor expansion - draw lines
Graphics_ Learnopongl learning notes