final protected function sanitize($data)
    {
        // Recursively loop through the data array and return the sanitized data
        $sanitized = [];
        if (is_array($data)) {
            foreach ($data as $key => $value) {
                $sanitized[$key] = $this->sanitize($value);
            }
        } else {
            $sanitized = trim(strip_tags($data));
        }
        return $sanitized;
    }
final protected function sanitize($data)
    {
        // Recursively loop through the data array and return the sanitized data
        $sanitized = [];
        if (is_array($data)) {
            foreach ($data as $key => $value) {
                $sanitized[$key] = $this->sanitize($value);
            }
        } else {
            $sanitized = trim(strip_tags($data));
        }
        return $sanitized;
    }
final protected function sanitize ( $ data ) { // Recursively loop through the data array and return the sanitized data $ sanitized = [ ] ; if ( is_array ( $ data ) ) { foreach ( $ data as $ key => $ value ) { $ sanitized [ $ key ] = $ this -> sanitize ( $ value ) ; } } else { $ sanitized = trim ( strip_tags ( $ data ) ) ; } return $ sanitized ; }
Sanitizes an array with data.

@param array $data The input data.

@return array A sanitized array.
Sanitizes an array with data .