protected function _element($data = '', $tab = '', $start = 0) { static $start; $eof = eol(); $output = ''; $attrs = ''; $tab = str_repeat("\t", $start); if (!is_array($data)) { return $data . $eof; } else { foreach ($data as $k => $v) { if (is_numeric($k)) { $k = 'li'; } $end = "/" . Arrays::getFirst(explode(' ', $k)); if (!is_array($v)) { $output .= "{$tab}<{$k}>{$v}<{$end}>{$eof}"; } else { $output .= $tab . "<{$k}>{$eof}" . $this->_element($v, $tab, $start++) . $tab . "<{$end}>" . $tab . $eof; $start--; } } } return $output; }
public function convert($string = '', $fromEncoding = '', $toEncoding = '') { if (!is_string($string)) { return Error::set(lang('Error', 'stringParameter', '1.(string)')); } $toEncodingFirst = Arrays::getFirst(explode('//', $toEncoding)); if (!isCharset($fromEncoding) || !isCharset($toEncodingFirst)) { return Error::set(lang('Error', 'charsetParameter', '2.(fromEncoding) & 3.(toEncoding)')); } return iconv($fromEncoding, $toEncoding, $string); }