1--TEST--
2Test array_change_key_case() function : usage variations - multidimensional arrays
3--FILE--
4<?php
5/* Prototype  : array array_change_key_case(array $input [, int $case])
6 * Description: Returns an array with all string keys lowercased [or uppercased]
7 * Source code: ext/standard/array.c
8 */
9
10/*
11 * Test how array_change_key_case() converts keys in multi-dimensional arrays
12 */
13
14echo "*** Testing array_change_key_case() : usage variations ***\n";
15
16$input = array('English' => array('one' => 1, 'two' => 2, 'three' => 3),
17               'French'  => array('un' => 1, 'deux' => 2, 'trois' => 3),
18               'German'  => array('eins' => 1, 'zwei' => 2, 'drei' => 3));
19
20echo "\n-- Pass a two-dimensional array as \$input argument --\n";
21var_dump(array_change_key_case($input, CASE_UPPER));
22
23echo "\n-- Pass a sub-arry as \$input argument --\n";
24var_dump(array_change_key_case($input['English'], CASE_UPPER));
25
26echo "Done";
27?>
28--EXPECT--
29*** Testing array_change_key_case() : usage variations ***
30
31-- Pass a two-dimensional array as $input argument --
32array(3) {
33  ["ENGLISH"]=>
34  array(3) {
35    ["one"]=>
36    int(1)
37    ["two"]=>
38    int(2)
39    ["three"]=>
40    int(3)
41  }
42  ["FRENCH"]=>
43  array(3) {
44    ["un"]=>
45    int(1)
46    ["deux"]=>
47    int(2)
48    ["trois"]=>
49    int(3)
50  }
51  ["GERMAN"]=>
52  array(3) {
53    ["eins"]=>
54    int(1)
55    ["zwei"]=>
56    int(2)
57    ["drei"]=>
58    int(3)
59  }
60}
61
62-- Pass a sub-arry as $input argument --
63array(3) {
64  ["ONE"]=>
65  int(1)
66  ["TWO"]=>
67  int(2)
68  ["THREE"]=>
69  int(3)
70}
71Done
72