当前位置:网站首页>PHP converts a one-dimensional array into a two-dimensional array
PHP converts a one-dimensional array into a two-dimensional array
2022-07-03 16:33:00 【Leaf drop traceless 123】
$fruit = array('a' => 'apple', 'b' => 'banana', 'c' => 'cranberry');
$fruit = array(
array('key'=>'a', 'val'=>'apple'),
array('key'=>'b', 'val'=> 'banana'),
array('key'=>'c', 'val'=> 'cranberry')
);
$fruit = array('a' => 'apple', 'b' => 'banana', 'c' => 'cranberry');
$tmp = array();
reset($fruit);
while (list($key, $val) = each($fruit)) {
$tmp[] = array('key'=>$key,'val'=>$val);
}
print_r($tmp);
边栏推荐
- 消息队列消息丢失和消息重复发送的处理策略
- Top k questions of interview
- Hibernate的缓存机制/会话级缓存机制
- 如何在本机搭建SVN服务器
- Learn from me about the enterprise flutter project: simplified framework demo reference
- Pointcut expression
- (Supplement) double pointer topic
- Register in PHP_ Globals parameter settings
- To resist 7-Zip, list "three sins"? Netizen: "is the third key?"
- NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线
猜你喜欢

Learn from me about the enterprise flutter project: simplified framework demo reference

NFT new opportunity, multimedia NFT aggregation platform okaleido will be launched soon

A survey of state of the art on visual slam

MySQL converts comma separated attribute field data from column to row

(Supplement) double pointer topic

关于视觉SLAM的最先进技术的调查-A survey of state-of-the-art on visual SLAM

Mysql 将逗号隔开的属性字段数据由列转行

ThreeJS 第二篇:顶点概念、几何体结构

Explore Cassandra's decentralized distributed architecture

Zebras are recognized as dogs, and Stanford found the reason why AI made mistakes
随机推荐
Asemi rectifier bridge umb10f parameters, umb10f specifications, umb10f package
Google Earth engine (GEE) - daymet v4: daily surface weather data set (1000m resolution) including data acquisition methods for each day
Advanced Mathematics (Seventh Edition) Tongji University exercises 2-1 personal solutions
Construction practice camp - graduation summary of phase 6
一台服务器最大并发 tcp 连接数多少?65535?
To resist 7-Zip, list "three sins"? Netizen: "is the third key?"
Remote file contains actual operation
程序猿如何快速成长
word 退格键删除不了选中文本,只能按delete
Acwing game 58
Uploads labs range (with source code analysis) (under update)
Colab works with Google cloud disk
Le zèbre a été identifié comme un chien, et la cause de l'erreur d'AI a été trouvée par Stanford
香港理工大学|数据高效的强化学习和网络流量动态的自适应最优周界控制
Pyinstaller is not an internal or external command, nor is it a runnable program or batch file
(补)双指针专题
Nifi from introduction to practice (nanny level tutorial) - flow
【剑指 Offer】58 - II. 左旋转字符串
Custom plug-in construction and use of QT plug-in
疫情常态化大背景下,关于远程办公的思考|社区征文