protected static function buildEscapeCodes($mode_texts) {
    if (!is_array($mode_texts)) { $mode_texts = array($mode_texts); }

    $code_text = '';
    foreach ($mode_texts as $mode) {
      $constant_name = 'self::CONSOLE_'.strtoupper($mode);
      if (defined($constant_name)) {
        $code_text .= (strlen($code_text) ? ';': '').constant($constant_name);
      }
    }

    return chr(27)."[0;".$code_text."m";
  }
protected static function buildEscapeCodes($mode_texts) {
    if (!is_array($mode_texts)) { $mode_texts = array($mode_texts); }

    $code_text = '';
    foreach ($mode_texts as $mode) {
      $constant_name = 'self::CONSOLE_'.strtoupper($mode);
      if (defined($constant_name)) {
        $code_text .= (strlen($code_text) ? ';': '').constant($constant_name);
      }
    }

    return chr(27)."[0;".$code_text."m";
  }
protected static function buildEscapeCodes ( $ mode_texts ) { if ( ! is_array ( $ mode_texts ) ) { $ mode_texts = array ( $ mode_texts ) ; } $ code_text = '' ; foreach ( $ mode_texts as $ mode ) { $ constant_name = 'self::CONSOLE_' . strtoupper ( $ mode ) ; if ( defined ( $ constant_name ) ) { $ code_text .= ( strlen ( $ code_text ) ? ';' : '' ) . constant ( $ constant_name ) ; } } return chr ( 27 ) . "[0;" . $ code_text . "m" ; }
builds ANSI escape codes

@param mixed $mode_texts An array of mode texts like bold or white.  Can also be a single string.

@return string ANSI escape code to activate the modes
builds ANSI escape codes