PHP Convert variable names to lowercase?

Posted by VeeBee on Stack Overflow See other posts from Stack Overflow or by VeeBee
Published on 2010-06-02T03:03:01Z Indexed on 2010/06/02 3:13 UTC
Read the original article Hit count: 231

Filed under:

I have an api listener script which takes in get parameters. But I seem to be having issues when users tend to pass mixed case variable names on the parameters.

For example:

http://mylistenerurl.com?paramName1=Hello&paramname2=World

I need my listener to be flixible in such a way that the variable names will be interpreted case-insensitively or rather still all in lower case like after I process the query string on some function, they are all returned as lower-cased variables:

extract(someFunction($_GET));
process($paramname1, $paramname2);

Can anybody shed some light on this?

*much appreciated. thanks!

© Stack Overflow or respective owner

Related posts about php