\cge_param

A set of utilities for cleaning input parameters.

Summary

Methods
Properties
Constants
get_html()
get_int()
get_bool()
get_string()
get_float()
get_string_array()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

get_html()

get_html(array $params, string $key, string $dflt)

Get safe HTML from an input parameter.

This method uses htmlawed to clean input HTML.

Parameters

array $params

An associative array of input params

string $key

The key to the associative array

string $dflt

The default value to use if the key does not exist in the $params aray.

get_int()

get_int(array $params, string $key, int $dflt)

Get a safe integer from an input parameter.

Parameters

array $params

An associative array of input params

string $key

The key to the associative array

int $dflt

The default value to use if the key does not exist in the $params aray.

get_bool()

get_bool(array $params, string $key, bool $dflt)

Get a safe boolean from an input parameter.

This method can accept boolean strings like yes, no, true, false, on, off.

Parameters

array $params

An associative array of input params

string $key

The key to the associative array

bool $dflt

The default value to use if the key does not exist in the $params aray.

get_string()

get_string(array $params, string $key, string $dflt)

Get a safe string from an input parameter.

The string is stripped of any javascript or html code.

Parameters

array $params

An associative array of input params

string $key

The key to the associative array

string $dflt

The default value to use if the key does not exist in the $params aray.

get_float()

get_float(array $params, string $key, float $dflt)

Get a safe float from an input parameter.

Parameters

array $params

An associative array of input params

string $key

The key to the associative array

float $dflt

The default value to use if the key does not exist in the $params aray.

get_string_array()

get_string_array(array $params, string $key, string[] $dflt)

Get a safe array of strings from an input parameter that is an array.

Parameters

array $params

An associative array of input params

string $key

The key to the associative array

string[] $dflt

The default value to use if the key does not exist in the $params aray.