IT. Expert System.

PHP

Changes all keys in an array


array_change_key_case

(PHP 4 >= 4.2.0, PHP 5)

array_change_key_caseChanges all keys in an array

Description

array array_change_key_case ( array $input [, int $case = CASE_LOWER ] )

Returns an array with all keys from input lowercased or uppercased. Numbered indices are left as is.

Parameters

input

The array to work on

case

Either CASE_UPPER or CASE_LOWER (default)

Return Values

Returns an array with its keys lower or uppercased, or FALSE if input is not an array.

Errors/Exceptions

Throws E_WARNING if input is not an array.

Examples

Example #1 array_change_key_case() example

<?php
$input_array 
= array("FirSt" => 1"SecOnd" => 4);
print_r(array_change_key_case($input_arrayCASE_UPPER));
?>

The above example will output:

 Array (  [FIRST] => 1  [SECOND] => 4 ) 

Notes

Note:

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.



Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 246 / 158692599. Delta: 0.10545 с