当前位置:网站首页>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>";
}
?>

边栏推荐
- 【Rust 笔记】07-结构体
- Unity editor expansion - controls, layouts
- Solution détaillée de toutes les formules de fonction de transfert (fonction d'activation) du réseau neuronal MATLAB
- [rust notes] 07 structure
- Unity editor expansion - scrolling list
- 单调栈-42. 接雨水
- 【Rust笔记】05-错误处理
- 796 · 开锁
- [RPC] RPC remote procedure call
- [concurrent programming] working mechanism and type of thread pool
猜你喜欢

了解小程序的笔记 2022/7/3

100 GIS practical application cases (78) - Multi compliance database design and data warehousing

Unity editor expansion - scrolling list

Collection interface

Monotonic stack -84 The largest rectangle in the histogram

UE4 source code reading_ Mobile synchronization

matlab神经网络所有传递函数(激活函数)公式详解

Campus lost and found platform based on SSM, source code, database script, project import and operation video tutorial, Thesis Writing Tutorial
![P1596 [USACO10OCT]Lake Counting S](/img/a7/07a84c93ee476788d9443c0add808b.png)
P1596 [USACO10OCT]Lake Counting S

Message queue for interprocess communication
随机推荐
Solution détaillée de toutes les formules de fonction de transfert (fonction d'activation) du réseau neuronal MATLAB
[rust note] 10 operator overloading
Markdown directory generation
Kunlunbase meetup is waiting for you!
Log4j2 vulnerability recurrence and analysis
Development material set
[rust notes] 12 closure
Message pack in C deserializes array objects
单调栈-503. 下一个更大元素 II
Unity editor expansion - the framework and context of unity imgui
[rust notes] 13 iterator (Part 1)
Use of ue5 QRcode plug-in
Downward compatibility and upward compatibility
Explain sizeof, strlen, pointer, array and other combination questions in detail
Display terrain database on osgearth ball
JS non Boolean operation - learning notes
Osgearth topographic shading map drawing
Concurrent programming (V) detailed explanation of atomic and unsafe magic classes
[MySQL] MySQL Performance Optimization Practice: introduction of database lock and index search principle
VIM learning notes from introduction to silk skating