简体   繁体   中英

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?

您可以解析$_SERVER['QUERY_STRING']并将其设置为$_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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM