/** * Converts a UTF8-string into HTML entities * * When using UTF-8 as a charset you want to convert multi-byte characters. * This function takes multi-byte characters up to level 4 into account. * Htmlentities will only convert 1-byte and 2-byte characters. * Use this function if you want to convert 3-byte and 4-byte characters also. * * @author silverbeat gmx at * @link http://www.php.net/manual/de/function.htmlentities.php#96648 * * @param $utf8 string The UTF8-string to convert * @param $encodeTags booloean TRUE will convert "<" to "<", Default = false * @return returns the converted HTML-string */ public static function UTF8_to_HTML($utf8, $encodeTags = false) { // check if this function was aleady loaded if (isset(self::$already_loaded[__FUNCTION__]) === false) { // if not, load function include __DIR__ . '/Pool/' . __FUNCTION__ . '.php'; // function loaded successfully self::$already_loaded[__FUNCTION__] = true; } // calling the loaded function return UTF8_to_HTML($utf8, $encodeTags); }
/** * Converts a UTF8-string into HTML entities. * * When using UTF-8 as a charset you want to convert multi-byte characters. * This function takes multi-byte characters up to level 4 into account. * Htmlentities will only convert 1-byte and 2-byte characters. * Use this function if you want to convert 3-byte and 4-byte characters also. * * @author silverbeat gmx at * * @link http://www.php.net/manual/de/function.htmlentities.php#96648 * * @param $utf8 string The UTF8-string to convert * @param $encodeTags booloean TRUE will convert "<" to "<", Default = false * * @return string the converted HTML-string */ public static function utf8ToHtml($utf8, $encodeTags = false) { include_once __DIR__ . '/Pool/UTF8_to_HTML.php'; // calling the loaded function return UTF8_to_HTML($utf8, $encodeTags); }