gpt4 book ai didi

php - 如何使用 CodeIgniter 检索 HTTP $_GET 值

转载 作者:可可西里 更新时间:2023-11-01 13:33:17 25 4
gpt4 key购买 nike

我坚持在 CodeIgniter 中使用 $_GET 变量,有人可以帮助我吗?

最佳答案

CodeIgniter comes with three helper functions that let you fetch POST, COOKIE or SERVER items. The main advantage of using the provided functions rather than fetching an item directly ($_POST['something']) is that the functions will check to see if the item is set and return false (boolean) if not. This lets you conveniently use data without having to test whether an item exists first. In other words, normally you might do something like this:

if (!isset($_GET['something'])){
$something = FALSE;
} else {
$something = $_GET['something'];
}

With CodeIgniter's built in functions you can simply do this:

$something = $this->input->get('something');

取自here .

关于php - 如何使用 CodeIgniter 检索 HTTP $_GET 值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5785664/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com