public function scrub($var)
	{
		if (is_string($var)) {
			// Sanitize strings
			return $this->escape($var);

		} elseif (is_array($var)) {
			// Sanitize arrays
                        foreach($var as $key => $value){
				// casting key to string for the case of numeric indexed arrays
				// i.e. 0, 1, etc. b/c 0 == any string in php
				if (!in_array((string)$key, $this->unguarded)) {
					$var[$key] = $this->scrub($value);
				}
			}

			return $var;
		} elseif (is_object($var)) {
			// Sanitize objects
			$values = get_object_vars($var);

			foreach ($values as $key => $value) {
				$var->$key = $this->scrub($value);
			}
			return $var;

		} else {
			// Not sure what this is. null or bool? Just return it.
			return $var;
		}
	}
public function scrub($var)
	{
		if (is_string($var)) {
			// Sanitize strings
			return $this->escape($var);

		} elseif (is_array($var)) {
			// Sanitize arrays
                        foreach($var as $key => $value){
				// casting key to string for the case of numeric indexed arrays
				// i.e. 0, 1, etc. b/c 0 == any string in php
				if (!in_array((string)$key, $this->unguarded)) {
					$var[$key] = $this->scrub($value);
				}
			}

			return $var;
		} elseif (is_object($var)) {
			// Sanitize objects
			$values = get_object_vars($var);

			foreach ($values as $key => $value) {
				$var->$key = $this->scrub($value);
			}
			return $var;

		} else {
			// Not sure what this is. null or bool? Just return it.
			return $var;
		}
	}
public function scrub ( $ var ) { if ( is_string ( $ var ) ) { // Sanitize strings return $ this -> escape ( $ var ) ; } elseif ( is_array ( $ var ) ) { // Sanitize arrays foreach ( $ var as $ key => $ value ) { // casting key to string for the case of numeric indexed arrays // i.e. 0, 1, etc. b/c 0 == any string in php if ( ! in_array ( ( string ) $ key , $ this -> unguarded ) ) { $ var [ $ key ] = $ this -> scrub ( $ value ) ; } } return $ var ; } elseif ( is_object ( $ var ) ) { // Sanitize objects $ values = get_object_vars ( $ var ) ; foreach ( $ values as $ key => $ value ) { $ var -> $ key = $ this -> scrub ( $ value ) ; } return $ var ; } else { // Not sure what this is. null or bool? Just return it. return $ var ; } }
Recursively sanitize output.

@param $var
@return array
Recursively sanitize output .