Input::exists (method)

Last updated: Tue, Oct 31, 2023 11:48 am
Return to Knowledgebase

Purpose

Checks if $_GET or $_POST form input exists

Location

users/classes/Input.php

Parameters

# Parameter Data Type Required Description
1 $type = 'post' Yes undocumented

Example

Input::exists()

Further Documentation:

Checks for the existence of post or get info. Note that the only 2 options are 'post' (which does not need to be explicitly stated or 'get' which does. Essentially you are looking for the existence of get or post, but nothing else specific about it.
If nothing is passed, it checks for $_POST. You can also do

if(Input::exists('get')){
//do something
}

to check for the existence of $_GET data.