php - change key case with array_change_key_case function

php
voted: 0
vote
php array case

php - change key case with array_change_key_case function

<?php
$codes = array(
	    'aBc' => 'abc',
	    'aBC' => 'aabC',
	    'aBCd' => 'abc',
	    'bCd' => 'bcd'
	);
print_r(array_change_key_case($codes, CASE_UPPER));
print_r(array_change_key_case($codes, CASE_LOWER));
?>

output:
Array
(
    [abc] => aabC
    [abcd] => abc
    [bcd] => bcd
)
Array
(
    [ABC] => aabC
    [ABCD] => abc
    [BCD] => bcd
)
working url: not entered
version: not entered
Leave a Comment:
Characters left:
No comments yet.