/** * Convert special chars to html entities * * @param string $str * @param int $quote_stype * @param string $charset * @param boolean $double_encode * * @return string */ public static function htmlspecialchars($str, $quote_style = ENT_COMPAT, $charset = null, $double_encode = false) { if (version_compare(PHP_VERSION, '5.2.3', '>=')) { return htmlspecialchars($str, $quote_style, null == $charset ? self::$instance->getEncoding() : $charset, $double_encode); } else { return htmlspecialchars($str, $quote_style, null == $charset ? self::$instance->getEncoding() : $charset); } }
/** * Convert special chars to html entities * @param string $str * @param int $quote_stype * @param string $charset * @param boolean $double_encode * * @return string */ public static function htmlspecialchars($str, $quote_style = ENT_COMPAT, $charset = null, $double_encode = false) { return htmlspecialchars($str, $quote_style, null == $charset ? self::$instance->getEncoding() : $charset, $double_encode); }
/** * Get current encoding * * @return string */ public static function getEncoding() { return self::$instance->getEncoding(); }
/** * Convert all applicable characters to HTML entities * * @param string $string The input string. * @param integer $quote_style Quote style * @param string $charset Character set, UTF-8 by default * @param boolean $double_encode If set to false, no encoding of existing entities * * @return string */ public static function htmlentities($string, $quote_style = ENT_COMPAT, $charset = null, $double_encode = true) { return htmlentities($string, $quote_style, null == $charset ? self::$instance->getEncoding() : $charset, $double_encode); }