当前位置:网站首页>PHP two-dimensional array specifies that the elements are added after they are equal, otherwise new
PHP two-dimensional array specifies that the elements are added after they are equal, otherwise new
2022-04-23 09:49:00 【Alexandria sea】
$pr_prduct = array();
$pr_prduct_or = explode(',', Dakuohao($rs["pin_ren_order"], false));
$ij = 0;
for ($or = 0; $or < count($pr_prduct_or); $or++) {
$sqllist = "select * from shop_list where orderid=" . $pr_prduct_or[$or] . " ";
$arrlist = _get_all($sqllist);
foreach ($arrlist as $ilist => $rslist) {
$demo = array_search($rslist["p_id"], array_column($pr_prduct, 'p_id'));// Compare with the library , Existence addition , No new
if (is_numeric($demo)) {
$pr_prduct[$demo]["productnum"] += $rslist["productnum"];
} else {
$pr_prduct[$ij]["p_id"] = $rslist["p_id"];
$pr_prduct[$ij]["productnum"] = $rslist["productnum"];
$ij++;
}
}
}
版权声明
本文为[Alexandria sea]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230937288084.html
边栏推荐
- [COCI] lattice (dichotomy + tree divide and conquer + string hash)
- Amazon cloud technology entry Resource Center, easy access to the cloud from 0 to 1
- Redis 内存占满导致的 Setnx 命令执行失败
- SAP RFC_ CVI_ EI_ INBOUND_ Main BP master data creation example (Demo customer only)
- SAP pi / PO soap2proxy consumption external WS example
- Kernel PWN learning (3) -- ret2user & kernel ROP & qwb2018 core
- JSON input of Chapter 14 of kettle paoding jieniu
- MySQL of database -- basic common query commands
- Chapter VIII project stakeholder management of information system project manager summary
- Where is int a = 1 stored
猜你喜欢
Leetcode题库78. 子集(递归 c实现)
Comparison of overloading, rewriting and hiding
AI上推荐 之 MMOE(多任务yyds)
Go language learning notes - slice, map | go language from scratch
High paid programmer & interview question series 91 limit 20000 loading is very slow. How to solve it? How to locate slow SQL?
Number theory blocking (integer division blocking)
Career planning and implementation in the era of meta universe
kettle庖丁解牛第14篇之JSON输入
3、 6 [Verilog HDL] gate level modeling of basic knowledge
Construire neuf capacités de fabrication agile à l'ère métacosmique
随机推荐
Go language learning notes - slice, map | go language from scratch
JS and how to judge custom attributes in H5
JS DOM learn three ways to create elements
Kettle experiment conversion case
Educational Codeforces Round 81 (Rated for Div. 2)
论文阅读《Integrity Monitoring Techniques for Vision Navigation Systems》
Kettle experiment
最长公共前串
[ACM-ICPC 2018 Shenyang Network preliminaries] J. Ka Chang (block + DFS sequence)
MySQL of database -- overview and installation
JSON input of Chapter 14 of kettle paoding jieniu
SAP debug debug for in, reduce and other complex statements
A concise course of fast Fourier transform FFT
《信息系统项目管理师总结》第八章 项目干系人管理
Installation of data cleaning ETL tool kettle
Go language learning notes - array | go language from scratch
High paid programmer & interview question series 91 limit 20000 loading is very slow. How to solve it? How to locate slow SQL?
[2020wc Day2] F. Clarice picking mushrooms (subtree and query, light and heavy son thought)
Planning and construction of industrial meta universe platform
Kettle experiment (III)