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

边栏推荐
- Use of ue5 QRcode plug-in
- VIM learning notes from introduction to silk skating
- Introduction to hexadecimal coding
- C language student management system based on linked list, super detailed
- 【Rust笔记】02-所有权
- Binary to decimal, decimal to binary
- [RPC] RPC remote procedure call
- Drawing maze EasyX library with recursive backtracking method
- Markdown directory generation
- [updating] wechat applet learning notes_ three
猜你喜欢

Monotonic stack -42 Connect rainwater

Animation_ IK overview

Life cycle of Servlet

梯度下降法求解BP神经网络的简单Demo

Creation of osgearth earth files to the earth ------ osgearth rendering engine series (1)

ES6 promise learning notes

Drawing maze EasyX library with recursive backtracking method
![[concurrent programming] thread foundation and sharing between threads](/img/26/60fbfe65b186867a3b1cb58d481226.jpg)
[concurrent programming] thread foundation and sharing between threads

【Rust笔记】02-所有权

Gradle's method of dynamically modifying APK package name
随机推荐
Vscode, idea, VIM development tool shortcut keys
[rust notes] 06 package and module
Servlet的生命周期
【Rust 笔记】13-迭代器(上)
Analysis of Alibaba canal principle
Constraintlayout's constraintset dynamically modifies constraints
MySQL three logs
Advanced OSG collision detection
[concurrent programming] explicit lock and AQS
Dom4j遍历和更新XML
[rust notes] 09- special types and generics
Monotonic stack -42 Connect rainwater
Thymeleaf 404 reports an error: there was unexpected error (type=not found, status=404)
Life cycle of Servlet
Unity editor expansion - controls, layouts
了解小程序的笔记 2022/7/3
URL backup 1
How does unity fixedupdate call at a fixed frame rate
Some understandings of 3dfiles
Unity interactive water ripple post-treatment