Home > php教程 > php手册 > body text

php 按列值合并数据,php合并数据

WBOY
Release: 2016-06-13 09:07:55
Original
840 people have browsed it

php 按列值合并数据,php合并数据

Copy after login
Copy after login
Copy after login
    <span>/*</span><span>
     * PHP按值合并数组
     * </span><span>*/</span>
    <span>function</span> my_array_merge(&<span>$array1</span>, &<span>$array2</span><span>) {
        </span><span>$result</span> = <span>Array</span><span>();
        </span><span>foreach</span>(<span>$array1</span> <span>as</span> <span>$key</span> => &<span>$value</span><span>) {
            </span><span>$result</span>[<span>$key</span>] = <span>array_merge</span>(<span>$value</span>, <span>$array2</span>[<span>$key</span><span>]);
        }
        </span><span>return</span> <span>$result</span><span>;
    }</span>
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login

 

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template