Home > Backend Development > PHP Tutorial > php 按列值合并数据,php合并数据_PHP教程

php 按列值合并数据,php合并数据_PHP教程

WBOY
Release: 2016-07-13 09:58:07
Original
988 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

 

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/978699.htmlTechArticlephp 按列值合并数据,php合并数据 /* * PHP按值合并数组 * */ function my_array_merge( $array1 , $array2 ) { $result = Array (); foreach ( $array1 as $key = $value )...
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template