[ create a new paste ] login | about

Link: http://codepad.org/pprRR5wS    [ raw code | output | fork ]

PHP, pasted on Apr 25:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php

$arr = $array = array(
    array(
        'element1' => a,
        'element2' => b
    ),
    array(
        'element1' => c,
        'element2' => d
    )
);

print_r(array_map("getFunc", $arr));

function getFunc($a) 
{ 
    return $a['element1']; 
}

?>


Output:
1
2
3
4
5
Array
(
    [0] => a
    [1] => c
)


Create a new paste based on this one


Comments: