Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online

array change key case function syntax tag tutorial 2013





Alert! Connect with 10,000 Chating Online. Join Now

Php array change key case () function

Write your php code

 
<?php ?>

Php Result


Your code below



(PHP 4 >= 4.2.0, PHP 5)

array_change_key_case -- Returns an array with all string keys lowercased or uppercased

Syntax

array array_change_key_case ( array input [, int case] )

array_change_key_case() changes the keys in the input array to be all lowercase or uppercase. The change depends on the last optional case parameter. You can pass two constants there, CASE_UPPER and CASE_LOWER. The default is CASE_LOWER. The function will leave number indices as is.

Example 1. array_change_key_case() 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
)

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 array change key case Function syntax tag

array change key case php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online



Php array change key case syntax tutorial

php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.


Function index

Variables

Expressions

Operators

Control-Structures

Cookies

Array

Date & Time

Directory function

File

Image

Operators

Form data handling

Mathematics operators

Mail

Php Mysql

Network Functions

Strings

php tutorial guides,functions, classes, code examples and tags for creating simple dynamic site to mysql database driven sites
 
 
Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online