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

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

WBOY
WBOYOriginal
2016-07-13 09:58:071010browse

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



    <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>



 

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/978699.htmlTechArticlephp 按列值合并数据,php合并数据 /* * PHP按值合并数组 * */ function my_array_merge( $array1 , $array2 ) { $result = Array (); foreach ( $array1 as $key = $value )...
Statement:
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