php - Looking for array_map equivalent to work on keys in associative arrays -


suppose have associative array:

    $array = array(       "key1" => "value",       "key2" => "value2"); 

and wanted make keys uppercase. how in generalized way (meaning apply user defined function apply key names)?

you can use array_change_key_case function of php

<?php $input_array = array("first" => 1, "second" => 4); print_r(array_change_key_case($input_array, case_upper)); ?> 

Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -