public static function strEscape( $str, $escape = 'plain' ) {
		switch ( $escape ) {
			case 'html' :
			case 'htmlspecialchars' :
				$str = htmlspecialchars( $str );
				break;
			case 'htmlentities':
				$str = htmlentities( $str, ENT_QUOTES, 'UTF-8' );
				break;
			// 'plain' or anything else: Do nothing
		}
		return $str;
	}
public static function strEscape( $str, $escape = 'plain' ) {
		switch ( $escape ) {
			case 'html' :
			case 'htmlspecialchars' :
				$str = htmlspecialchars( $str );
				break;
			case 'htmlentities':
				$str = htmlentities( $str, ENT_QUOTES, 'UTF-8' );
				break;
			// 'plain' or anything else: Do nothing
		}
		return $str;
	}
public static function strEscape ( $ str , $ escape = 'plain' ) { switch ( $ escape ) { case 'html' : case 'htmlspecialchars' : $ str = htmlspecialchars ( $ str ) ; break ; case 'htmlentities' : $ str = htmlentities ( $ str , ENT_QUOTES , 'UTF-8' ) ; break ; // 'plain' or anything else: Do nothing } return $ str ; }
Escapes a string with one of the known method and returns it

@param string $str The string to be escaped
@param string $escape The name of the escape routine to be used
if this is an unknown method name it will be ignored and 'plain'
will be used instead.
@return string The escaped string.
Escapes a string with one of the known method and returns it