webCOMAND

request::get()

The get method provides access to HTTP (and HTTPS) GET query parameters.  GET parameters are made available to a web page through the URL requested.  For example, a GET parameter key "search" can be passed the value "test" with the URL http://www.example.com/script.php?search=test

Prototype

string get(string $key = NULL, boolean $xss_filter = FALSE)

Parameters

  • key - Name of the parameter to retrieve.  If NULL or no key is provided, an associative array of all parameters will be returned.
  • xss_filter - Optional parameter to enable the cross site scripting filter when available, which converts potentially malicious HTML tags into HTML entities.

Return

If the GET parameter exists, the value is returned as a string, including an empty string.  Otherwise, FALSE is returned.

Example

// retrieve the value of the "search" GET parameter from a URL like
// http://www.example.com/script.php?search=test
$request = new \io_comand_web\request();
$search = $request->get('search');