当前位置:网站首页>php 二维数组插入
php 二维数组插入
2022-06-23 14:24:00 【xufengnian_boke】
public function arrInsert($arr,$index,$data)
{
$c = count($arr);//总长度
if($c <= $index){
$arr[] = $data;
return $arr;
}
for ($i = ($c - 1);$i>=0;$i--){
//循环转移数组元素
$arr[($i+1)] = $arr[$i];
if($index == $i){
$arr[$i] = $data;
break;
}
}
}
边栏推荐
- MySQL create and manage tables
- Google &huggingface| zero sample language model structure with the strongest ability
- 【opencv450】椒盐噪声demo
- Analysis and solution of connection failure caused by MySQL using replicationconnection
- 等保備案是什麼意思?應該去哪裏辦理備案?
- How can genetic testing help patients fight disease?
- 小米为何深陷芯片泥潭?
- 狂奔的极兔,摔了一跤
- An idea plug-in for automatically generating unit tests
- Execute the sc.exe QC command to query some services. The data area passed to the system call is too small
猜你喜欢

Self inspection is recommended! The transaction caused by MySQL driver bug is not rolled back. Maybe you are facing this risk!

SQL注入漏洞(原理篇)

KDD'22「阿里」推荐系统中的通用序列表征学习
![[in depth understanding of tcapulusdb technology] tcapulusdb construction data](/img/0c/33d9387cd7733a0c6706a73f9535f7.png)
[in depth understanding of tcapulusdb technology] tcapulusdb construction data

Raspberry PI installing the wiring pi

The new version of Alibaba Seata finally solves the idempotence, suspension and empty rollback problems of the TCC mode

2021-06-03

百万奖金等你来拿,首届中国元宇宙创新应用大赛联合创业黑马火热招募中!

直播间源码在开发前期必须做的工作及开发步骤

2021-06-07
随机推荐
WebService接口发布和调用
2021-06-07
如何使用笔记软件 FlowUs、Notion 进行间隔重复?基于公式模版
力扣解法匯總513-找樹左下角的值
Helm 基础入门 Helm介绍与安装
When I went to oppo for an interview, I got numb...
Google &huggingface| zero sample language model structure with the strongest ability
这届文娱人,将副业做成了主业
2021-05-08
期货怎么开户安全吗,期货手续费哪家期货公司比较低,适合散户开户?
WPF (c) new open source control library: newbeecoder UI waiting animation
[compréhension approfondie de la technologie tcaplusdb] données de construction tcaplusdb
AXI_Round_Robin_Arbiter 设计 - AW、W通道部分
How does activity implement lifecycleowner?
General sequence representation learning in kdd'22 "Ali" recommendation system
【二级等保】过二级等保用哪个堡垒机品牌好?
Short talk about community: how to build a game community?
[Level 2 warranty] which brand of Fortress machine is good for Level 2 warranty?
快速排序的简单理解
腾讯云服务器发送邮件失败