code igniter :: $_GET?
In my projects i often use get params as a temporary way to test things with different values.开发者_开发问答
However it seems like you cannot access get params in code igniter?
I am aware I could build a param into my functions and pass the value as a url segment.
But i dont want to be doing that every time I wish to test something.
So,
is there any way to use get values in CI?
You can parse $_SERVER['QUERY_STRING']
and set it as $_GET
:
parse_str($_SERVER['QUERY_STRING'], $_GET);
You can enable query strings in your config file. Find this.
$config['enable_query_strings'] = FALSE;
and change it to true.
精彩评论