Home >Backend Development >PHP Tutorial >小弟我想给每个值,都添加一个元素c => 3,有没有系统函数

小弟我想给每个值,都添加一个元素c => 3,有没有系统函数

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 11:40:26720browse

我想给每个值,都添加一个元素c => 3,有没有系统函数啊
我想给每个值,都添加一个元素c => 3,不用foreach可以吗,有没有系统函数啊
$ary = 
Array
(
    [0] => Array
        (
            [a] => 1
            [b] => 2    
        )
    [1] => Array
        (
            [a] => 1
            [b] => 2    
        )
    ...
)
目标:
Array
(
    [0] => Array
        (
            [a] => 1
            [b] => 2  
    [c] => 3 
        )
    [1] => Array
        (
            [a] => 1
            [b] => 2  
    [c] => 3 
        )
    ...
)

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