note 111001 added to function.array-fill-keys
| From: | atul dot kr_singh at hotmail dot com | Date: | Fri, 04 Jan 2013 11:39:12 +0000 |
| Subject: | note 111001 added to function.array-fill-keys | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-192760@lists.php.net to get a copy of this message | ||
If an associative array is used as the second parameter of array_fill_keys, then the associative
array will be appended in all the values of the first array.
e.g.
$array1 = array(
"a" => "first",
"b" => "second",
"c" => "something",
"red"
);
$array2 = array(
"a" => "first",
"b" => "something",
"letsc"
);
print_r(array_fill_keys($array1, $array2));
// The output will be
Array(
[first] => Array(
[a] => first,
[b] => something,
[0] => letsc
),
[second] => Array(
[a] => first,
[b] => something,
[0] => letsc
),
[something] => Array(
[a] => first,
[b] => something,
[0] => letsc
),
[red] => Array(
[a] => first,
[b] => something,
[0] => letsc
)
)
----
Server IP: 69.147.83.199
Probable Submitter: 111.93.167.67
----
Manual Page -- http://php.net/manual/en/function.array-fill-keys.php
Edit -- https://master.php.net/note/edit/111001
Del: integrated -- https://master.php.net/note/delete/111001/integrated
Del: useless -- https://master.php.net/note/delete/111001/useless
Del: bad code -- https://master.php.net/note/delete/111001/bad+code
Del: spam -- https://master.php.net/note/delete/111001/spam
Del: non-english -- https://master.php.net/note/delete/111001/non-english
Del: in docs -- https://master.php.net/note/delete/111001/in+docs
Del: other reasons-- https://master.php.net/note/delete/111001
Reject -- https://master.php.net/note/reject/111001
Search -- https://master.php.net/manage/user-notes.php