当前位置:网站首页>PHP 2D array insert
PHP 2D array insert
2022-06-23 15:10:00 【xufengnian_ boke】
public function arrInsert($arr,$index,$data)
{
$c = count($arr);// Total length
if($c <= $index){
$arr[] = $data;
return $arr;
}
for ($i = ($c - 1);$i>=0;$i--){
// Loop through array elements
$arr[($i+1)] = $arr[$i];
if($index == $i){
$arr[$i] = $data;
break;
}
}
}
边栏推荐
- Use of pyqt5 tool box
- PHP指定字段大于100正序排,小于100随机排
- 建議自查!MySQL驅動Bug引發的事務不回滾問題,也許你正面臨該風險!
- 山东:美食“隐藏款”,消费“扫地僧”
- MySQL advanced statement 2
- Redis缓存三大异常的处理方案梳理总结
- Helm 基础入门 Helm介绍与安装
- After nine years at the helm, the founding CEO of Allen Institute retired with honor! He predicted that Chinese AI would lead the world
- 地平线开发板 调试
- 物流贸易相关
猜你喜欢

这届文娱人,将副业做成了主业

Uniswap 收购 NFT交易聚合器 Genie,NFT 交易市场将生变局?

2021-06-03

Effect evaluation of regression model under credit product quota pricing scenario

Tencent ECS failed to send email

When I went to oppo for an interview, I got numb...

In this year's English college entrance examination, CMU delivered 134 high scores with reconstruction pre training, significantly surpassing gpt3
Analysis and solution of connection failure caused by MySQL using replicationconnection

JS创建一个数组(字面量)
![[in depth understanding of tcapulusdb technology] tcapulusdb business data backup](/img/1a/449b123c0f2046217ec60af36344eb.png)
[in depth understanding of tcapulusdb technology] tcapulusdb business data backup
随机推荐
In this year's English college entrance examination, CMU delivered 134 high scores with reconstruction pre training, significantly surpassing gpt3
Simple tutorial of live streaming with OBS
信贷产品额度定价场景下的回归模型效果评估
Error creating bean with name xxx Factory method ‘sqlSessionFactory‘ threw exception; nested excepti
MySQL高级语句二
go语言的变量声明
Self inspection is recommended! The transaction caused by MySQL driver bug is not rolled back. Maybe you are facing this risk!
2021-05-22
从3开始,在业务系统中增加分页功能
How to use note taking software flowus and note for interval repetition? Based on formula template
系统设计与分析-技术报告-定时清理验证码的一种解决方案
MySQL advanced statement 2
力扣解法汇总513-找树左下角的值
狂奔的极兔,摔了一跤
2021-06-03
2021-04-15
力扣解法匯總513-找樹左下角的值
Pyqt5 工具盒使用
Qu'est - ce que ça veut dire? Où dois - je m'inscrire?
mysql主从只同步部分库或表的思路与方法