I just wondered if there is a very easy way to determine whether the request is a $_POST
or a $_GET
request.
So does Codeigniter
have something like this?
$this->container->isGet();
I've never used codeigniter, but for this I check the $_SERVER['REQUEST_METHOD']
.
Looking at the docs maybe something like:
if ($this->input->server('REQUEST_METHOD') === 'GET') {
//its a get
} elseif ($this->input->server('REQUEST_METHOD') === 'POST') }
//its a post
}
If you're going to use it a lot then it's simple to roll your own isGet()
function for it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With