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

边栏推荐
- 二进制转十进制,十进制转二进制
- Deep parsing (picture and text) JVM garbage collector (II)
- GIS实战应用案例100篇(七十八)-多规合一数据库设计及数据入库
- [K & R] Chinese Second Edition personal questions Chapter1
- Unity editor expansion - draw lines
- 【Rust 笔记】13-迭代器(上)
- Find the intersection of line segments
- Osganimation library parsing
- Gradle's method of dynamically modifying APK package name
- Redis data structure
猜你喜欢

UE4 source code reading_ Bone model and animation system_ Animation process

Collection interface

Es8 async and await learning notes

数据库原理期末复习

Visual Studio (VS) shortcut keys

Concurrent programming (III) detailed explanation of synchronized keyword

VIM learning notes from introduction to silk skating

UE4 source code reading_ Bone model and animation system_ Animation compression
![[RPC] RPC remote procedure call](/img/dc/872204ea47fcff04cdb72e18a2a4ef.jpg)
[RPC] RPC remote procedure call

Some understandings of 3dfiles
随机推荐
Unity editor expansion - scrolling list
Display terrain database on osgearth ball
Deep parsing JVM memory model
【Rust 笔记】07-结构体
[concurrent programming] concurrent tool class of thread
【Rust 笔记】11-实用特型
MySQL three logs
Monotonic stack -503 Next bigger Element II
Creation and content of mapnode -- osgearth rendering engine series (2)
Notes on understanding applets 2022/7/3
【Rust笔记】05-错误处理
Kwai 20200412 recruitment
Dom4j遍历和更新XML
Collection interface
Message queue for interprocess communication
[concurrent programming] Table hopping and blocking queue
Redux - learning notes
Vscode, idea, VIM development tool shortcut keys
Huawei interview summary during the epidemic
Monotonic stack -84 The largest rectangle in the histogram