Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • how to change all keys in an array to lowercase.

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 121
    Comment on it

    Hello Readers ,

    If we want to change the array key lower case to uppercase and vice versa then their is PHP function array_change_key_case() .

    Example.

    <!DOCTYPE html>
    <html>
    <body>
    
    <?php
    $age=array("Peter"=>"35","Ben"=>"37","Joe"=>"43");
    print_r(array_change_key_case($age,CASE_LOWER));
    ?>
    
    </body>
    </html>
    

    Output:

    Array ( [PETER] => 35 [BEN] => 37 [JOE] => 43 ) 
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: