Query: array_change_key_case
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
ARRAY_CHANGE_KEY_CASE(3) 1 ARRAY_CHANGE_KEY_CASE(3) array_change_key_case - Changes the case of all keys in an arraySYNOPSISarray array_change_key_case (array $array, [int $case = CASE_LOWER])DESCRIPTIONReturns an array with all keys from $array lowercased or uppercased. Numbered indices are left as is.PARAMETERSo $array - The array to work on o $case - Either CASE_UPPER or CASE_LOWER (default)RETURN VALUESReturns an array with its keys lower or uppercased, or FALSE if $array is not an array.ERRORS/EXCEPTIONS Throws E_WARNING if $array is not an array.EXAMPLESExample #1 array_change_key_case(3) example <?php $input_array = array("FirSt" => 1, "SecOnd" => 4); print_r(array_change_key_case($input_array, CASE_UPPER)); ?> The above example will output: Array ( [FIRST] => 1 [SECOND] => 4 )NOTESNote If an array has indices that will be the same once run through this function (e.g. " keY" and " kEY"), the value that is later in the array will override other indices. PHP Documentation Group ARRAY_CHANGE_KEY_CASE(3)
Related Man Pages |
---|
array_pop(3) - php |
array_merge_recursive(3) - php |
array_flip(3) - php |
array_keys(3) - php |
array_slice(3) - php |
Similar Topics in the Unix Linux Community |
---|
PHP script that detects if auth is required or not on Apache Splunk |