当前位置:网站首页>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);
边栏推荐
- [combinatorics] summary of combinatorial identities (eleven combinatorial identities | proof methods of combinatorial identities | summation methods)*
- Golang 匿名函数使用
- Pyinstaller is not an internal or external command, nor is it a runnable program or batch file
- Chinese translation of Tagore's floating birds (1~10)
- Colab works with Google cloud disk
- 【剑指 Offer 】64. 求1+2+…+n
- Central South University | through exploration and understanding: find interpretable features with deep reinforcement learning
- ThreeJS 第二篇:顶点概念、几何体结构
- 2022爱分析· 国央企数字化厂商全景报告
- NSQ source code installation and operation process
猜你喜欢

Slam learning notes - build a complete gazebo multi machine simulation slam from scratch (III)
![[combinatorics] non descending path problem (number of non descending paths with constraints)](/img/89/bd1a2ddd9632ab5d4b4bee9336be51.jpg)
[combinatorics] non descending path problem (number of non descending paths with constraints)

The mixlab editing team is recruiting teammates~~

Explore Netease's large-scale automated testing solutions see here see here

One article takes you to understand machine learning
![[solved] access denied for user 'root' @ 'localhost' (using password: yes)](/img/71/1ff8ed1d773da99054310f96dca3f8.jpg)
[solved] access denied for user 'root' @ 'localhost' (using password: yes)

斑马识别成狗,AI犯错的原因被斯坦福找到了

Zebras are recognized as dogs, and Stanford found the reason why AI made mistakes

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

Google Earth engine (GEE) - daymet v4: daily surface weather data set (1000m resolution) including data acquisition methods for each day
随机推荐
Stm32f103c8t6 firmware library lighting
Characteristic polynomial and constant coefficient homogeneous linear recurrence
Slam learning notes - build a complete gazebo multi machine simulation slam from scratch (II)
(补)双指针专题
【LeetCode】94. Middle order traversal of binary tree
Unity project optimization case 1
LeetCode1491. Average value of wages after removing the minimum wage and the maximum wage
A survey of state of the art on visual slam
Record a jar package conflict resolution process
Add color to the interface automation test framework and realize the enterprise wechat test report
【剑指 Offer 】57 - II. 和为s的连续正数序列
word 退格键删除不了选中文本,只能按delete
Détails du contrôle de la congestion TCP | 3. Espace de conception
Why does the std:: string operation perform poorly- Why do std::string operations perform poorly?
Page dynamics [2]keyframes
Mysql 单表字段重复数据取最新一条sql语句
Aike AI frontier promotion (7.3)
Thread pool executes scheduled tasks
Using optimistic lock and pessimistic lock in MySQL to realize distributed lock
Learn from me about the enterprise flutter project: simplified framework demo reference