db::simple_fields PHP Method

simple_fields() static public method

If you use column names like user_username, user_id, etc. use this method on the result array to strip user_ of all fields
static public simple_fields ( array $array ) : array
$array array The result array
return array The result array without those damn prefixes.
    static function simple_fields($array)
    {
        if (empty($array)) {
            return false;
        }
        $output = array();
        foreach ($array as $key => $value) {
            $key = substr($key, strpos($key, '_') + 1);
            $output[$key] = $value;
        }
        return $output;
    }