SproutCMS

This is the code documentation for the SproutCMS project

function trim()

Recursive trim data

Alters in-place AND returns the array
This allows for use such as:

   $_SESSION['register']['field_values'] = Validator::trim($_POST);

When used like this, the session gets set and the POST data is also trimmed,
so can be used directly for database inserts.

Usage

array Validator::trim ( array &$data );

Arguments

  1. array $data (by reference)
    Data to trim. Passed by-reference.

Return value

  • array
    Trimmed data