original_string: public static function FontCodes($text,$advanced=TRUE,$charset='utf-8'){
      //special chars
      $text  = htmlspecialchars($text, ENT_QUOTES,$charset);
      /**
       * This array contains the main static bbcode
       * @var array $basic_bbcode
       */
      $basic_bbcode = array(
                  '[b]', '[/b]',
                  '[i]', '[/i]',
                  '[u]', '[/u]',
                  '[B]', '[/B]',
                  '[I]', '[/I]',
                  '[U]', '[/U]',
      );
      /**
       * This array contains the main static bbcode's html
       * @var array $basic_html
       */
      $basic_html = array(
                  '<b>', '</b>',
                  '<i>', '</i>',
                  '<u>', '</u>',
                  '<b>', '</b>',
                  '<i>', '</i>',
                  '<u>', '</u>',
      );
      /**
       *
       * Parses basic bbcode, used str_replace since seems to be the fastest
       */
      $text = str_replace($basic_bbcode, $basic_html, $text);
      //advanced BBCODE
      if ($advanced)
      {
        /**
         * This array contains the advanced static bbcode
         * @var array $advanced_bbcode
         */
        $advanced_bbcode = array(
                     '/\[c=([0-9a-fA-F]{6})\](.+)(\[\\c\])?/i',
        );
        /**
         * This array contains the advanced static bbcode's html
         * @var array $advanced_html
         */
        $advanced_html = array(
                     "<span style='color: #$1'>$2</span>",
                     );
  
        $text = htmlspecialchars(preg_replace($advanced_bbcode, $advanced_html,$text));
      }
      return $text;
    }
code: public static function FontCodes($text,$advanced=TRUE,$charset='utf-8'){
      //special chars
      $text  = htmlspecialchars($text, ENT_QUOTES,$charset);
      /**
       * This array contains the main static bbcode
       * @var array $basic_bbcode
       */
      $basic_bbcode = array(
                  '[b]', '[/b]',
                  '[i]', '[/i]',
                  '[u]', '[/u]',
                  '[B]', '[/B]',
                  '[I]', '[/I]',
                  '[U]', '[/U]',
      );
      /**
       * This array contains the main static bbcode's html
       * @var array $basic_html
       */
      $basic_html = array(
                  '<b>', '</b>',
                  '<i>', '</i>',
                  '<u>', '</u>',
                  '<b>', '</b>',
                  '<i>', '</i>',
                  '<u>', '</u>',
      );
      /**
       *
       * Parses basic bbcode, used str_replace since seems to be the fastest
       */
      $text = str_replace($basic_bbcode, $basic_html, $text);
      //advanced BBCODE
      if ($advanced)
      {
        /**
         * This array contains the advanced static bbcode
         * @var array $advanced_bbcode
         */
        $advanced_bbcode = array(
                     '/\[c=([0-9a-fA-F]{6})\](.+)(\[\\c\])?/i',
        );
        /**
         * This array contains the advanced static bbcode's html
         * @var array $advanced_html
         */
        $advanced_html = array(
                     "<span style='color: #$1'>$2</span>",
                     );
  
        $text = htmlspecialchars(preg_replace($advanced_bbcode, $advanced_html,$text));
      }
      return $text;
    }
code_tokens: public static function FontCodes ( $ text , $ advanced = TRUE , $ charset = 'utf-8' ) { //special chars $ text = htmlspecialchars ( $ text , ENT_QUOTES , $ charset ) ; /**
       * This array contains the main static bbcode
       * @var array $basic_bbcode
       */ $ basic_bbcode = array ( '[b]' , '[/b]' , '[i]' , '[/i]' , '[u]' , '[/u]' , '[B]' , '[/B]' , '[I]' , '[/I]' , '[U]' , '[/U]' , ) ; /**
       * This array contains the main static bbcode's html
       * @var array $basic_html
       */ $ basic_html = array ( '<b>' , '</b>' , '<i>' , '</i>' , '<u>' , '</u>' , '<b>' , '</b>' , '<i>' , '</i>' , '<u>' , '</u>' , ) ; /**
       *
       * Parses basic bbcode, used str_replace since seems to be the fastest
       */ $ text = str_replace ( $ basic_bbcode , $ basic_html , $ text ) ; //advanced BBCODE if ( $ advanced ) { /**
         * This array contains the advanced static bbcode
         * @var array $advanced_bbcode
         */ $ advanced_bbcode = array ( '/\[c=([0-9a-fA-F]{6})\](.+)(\[\\c\])?/i' , ) ; /**
         * This array contains the advanced static bbcode's html
         * @var array $advanced_html
         */ $ advanced_html = array ( "<span style='color: #$1'>$2</span>" , ) ; $ text = htmlspecialchars ( preg_replace ( $ advanced_bbcode , $ advanced_html , $ text ) ) ; } return $ text ; }
docstring: Helper Function
  Convery SWAT4 Server font codes into html tags
  
  @param string $data
  @return  string
docstring_tokens: Helper Function Convery SWAT4 Server font codes into html tags