当前位置:网站首页>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)
- 详解sizeof、strlen、指针和数组等组合题
- Drawing maze EasyX library with recursive backtracking method
- Downward compatibility and upward compatibility
- Cloudcompare learning (1) - cloudcompare compilation and common plug-in implementation
- Thymeleaf 404 reports an error: there was unexpected error (type=not found, status=404)
- [concurrent programming] explicit lock and AQS
- Alibaba canaladmin deployment and canal cluster Ha Construction
- JS non Boolean operation - learning notes
- Swagger document configuration
猜你喜欢

Chocolate installation

MySQL 8

Unity editor expansion - draw lines

UE4 source code reading_ Mobile synchronization

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

简易入手《SOM神经网络》的本质与原理

Data analysis exercises

Image processing 8-cnn image classification

Animation_ IK overview
随机推荐
Swagger document configuration
Data analysis exercises
【Rust 笔记】12-闭包
Concurrent programming (V) detailed explanation of atomic and unsafe magic classes
Unity Editor Extension - Outline
Alibaba canal actual combat
Explain sizeof, strlen, pointer, array and other combination questions in detail
分配异常的servlet
[concurrent programming] explicit lock and AQS
Dom4j遍历和更新XML
LinkedList set
Collection interface
Redux - learning notes
100 GIS practical application cases (78) - Multi compliance database design and data warehousing
【Rust 笔记】13-迭代器(上)
Unity editor expansion - scrolling list
[concurrent programming] thread foundation and sharing between threads
Osgearth starry background
使用base64编码传图片
详解sizeof、strlen、指针和数组等组合题