Skip to content

Instantly share code, notes, and snippets.

@vikaszeon
Last active August 29, 2015 14:18
Show Gist options
  • Save vikaszeon/1013910b1bdb925dd708 to your computer and use it in GitHub Desktop.
Save vikaszeon/1013910b1bdb925dd708 to your computer and use it in GitHub Desktop.
Handle case insensitive parameter in php
Using php function array_change_key_case() we can handle case insensitive parameter in php.
$params = array_change_key_case($_POST or $_GET);
Like your parameter in get request someurl.php?AC=user_info&User=vikas&passWord=123456
so after user array_change_key_case function you get all parametre either in small case or uppar case. if you want in uppar case we need to pass in fucntion ssecond parameter.
lowercase is by default.
array_change_key_case($_POST or $_GET , CASE_UPPER);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment