if (input_exists('username', $_POST)) { // process username input } else { // handle error }
if (input_exists('sort', $_GET)) { // process sorting preference } else { // default sorting }The input_exists function is part of the global PHP function library and does not require any specific package or library.