Convert the keys of an array into uppercase – PHP

<?php
  $testArray=array("key1"=>"Value1","key2"=>"Value2","key3"=>"Value3");
  print_r(array_change_key_case($testArray,CASE_UPPER));
  //Array ( [KEY1] => Value1 [KEY2] => Value2 [KEY3] => Value3 )
?>
Share

Leave a Reply

Your email address will not be published. Required fields are marked *