文字列中のひらがな・漢字を、可能な限りカタカナに変換し、文節と思われる部分にハイフンマイナスを挟みます。
@param string $kanjiAndKanaString
@return string
488362
protected static function translateUsingKatakana(string $kanjiAndKanaString): string
    {
        if (!static::$igo) {
            static::$igo = new \Igo\Tagger(['dict_dir' => __DIR__ . '/../../naist-jdic']);
        }

        return implode('-', array_map(function ($morpheme) {
            $feature = explode(',', $morpheme->feature);
            return isset($feature[8]) && !in_array($feature[1], ['数', 'アルファベット'])
                ? $feature[8]
                : $morpheme->surface;
        }, static::$igo->parse($kanjiAndKanaString)));
    }
968530
public function txts($string, $n)
	{
		$args  = func_get_args();
		$count = count($args);

		if ($count > 1)
		{
			// Try the key from the language plural potential suffixes
			$found = false;
			$suffixes = $this->getPluralSuffixes((int) $n);
			array_unshift($suffixes, (int) $n);
			foreach ($suffixes as $suffix)
			{
				$key = $string . '_' . $suffix;
				if ($this->hasKey($key))
				{
					$found = true;
					break;
				}
			}
			if (!$found)
			{
				// Not found so revert to the original.
				$key = $string;
			}
			if (is_array($args[$count - 1]))
			{
				$args[0] = $this->translate(
					$key, array_key_exists('jsSafe', $args[$count - 1]) ? $args[$count - 1]['jsSafe'] : false,
					array_key_exists('interpretBackSlashes', $args[$count - 1]) ? $args[$count - 1]['interpretBackSlashes'] : true
				);
			}
			else
			{
				$args[0] = $this->translate($key);
			}
			return call_user_func_array('sprintf', $args);
		}
		elseif ($count > 0)
		{

			// Default to the normal sprintf handling.
			$args[0] = $this->translate($string);
			return call_user_func_array('sprintf', $args);
		}

		return '';
	}
655809
public function toString(): string
    {
        $parts = array_map(
            function (RDN $rdn) {
                return $rdn->toString();
            }, array_reverse($this->_rdns));
        return implode(",", $parts);
    }
480426
function getSignatureString() {
		$parts = array();

		foreach($this->fieldsInOrder as $f) {
			$val = $this->$f;
			if ($val === null) {
				$val = "";
			}
			elseif (is_bool($val)) {
				if ($val) {
					$val = "true";
				} else {
					$val = "false";
				}
			} elseif (is_array($val)) {
				// There are never more than 2 levels, we don't need recursive walk
				$valParts = array();
				foreach($val as $v) {
					if (is_scalar($v)) {
						$valParts[] = $v;
					} else {
						$valParts[] = implode("|", $v);
					}
				}
				$val = implode("|", $valParts);
			}
			$parts[] = $val;
		}

		foreach ($this->auxFieldsInOrder as $f) {
			$val = $this->$f;
			if ($val !== null) {
				$parts[] = $val;
			}
		}

		return implode("|", $parts);
	}
1097881
public function toUpper()
        {
            $stringLen = strlen($this->dataStr);
            $p = 0;
            
            while ($p<$stringLen) {
                $mode = self::identifyMode(substr($this->dataStr, $p), $this->modeHint);
                if($mode == QR_MODE_KANJI) {
                    $p += 2;
                } else {
                    if (ord($this->dataStr[$p]) >= ord('a') && ord($this->dataStr[$p]) <= ord('z')) {
                        $this->dataStr[$p] = chr(ord($this->dataStr[$p]) - 32);
                    }
                    $p++;
                }
            }

            return $this->dataStr;
        }
543020
function toString()
    {
        $modes = array();
        $levels = array(E_USER_NOTICE  => 'notice',
                        E_USER_WARNING => 'warning',
                        E_USER_ERROR   => 'error');
        if ($this->mode & PEAR_ERROR_CALLBACK) {
            if (is_array($this->callback)) {
                $callback = (is_object($this->callback[0]) ?
                    strtolower(get_class($this->callback[0])) :
                    $this->callback[0]) . '::' .
                    $this->callback[1];
            } else {
                $callback = $this->callback;
            }
            return sprintf('[%s: message="%s" code=%d mode=callback '.
                           'callback=%s prefix="%s" info="%s"]',
                           strtolower(get_class($this)), $this->message, $this->code,
                           $callback, $this->error_message_prefix,
                           $this->userinfo);
        }
        if ($this->mode & PEAR_ERROR_PRINT) {
            $modes[] = 'print';
        }
        if ($this->mode & PEAR_ERROR_TRIGGER) {
            $modes[] = 'trigger';
        }
        if ($this->mode & PEAR_ERROR_DIE) {
            $modes[] = 'die';
        }
        if ($this->mode & PEAR_ERROR_RETURN) {
            $modes[] = 'return';
        }
        return sprintf('[%s: message="%s" code=%d mode=%s level=%s '.
                       'prefix="%s" info="%s"]',
                       strtolower(get_class($this)), $this->message, $this->code,
                       implode("|", $modes), $levels[$this->level],
                       $this->error_message_prefix,
                       $this->userinfo);
    }
1314869
public static function getPinyin($string, $encoding = 'utf-8')
    {
        if ($string != self::$string || $encoding != self::$encoding) {
            self::chineseToPinyin($string, $encoding);
        }
        return self::$pinyin;
    }
42572
public function toString($indent = null)
    {
        $output = parent::toString($indent);
        $output = str_replace(
            ['<title>', '</title>'], ['<h1>', '</h1>'], $output
        );

        return $output;
    }
896745
function getDN($format = FILE_X509_DN_ARRAY, $dn = NULL)
    {
        if (!isset($dn)) {
            $dn = isset($this->currentCert['tbsCertList']) ? $this->currentCert['tbsCertList']['issuer'] : $this->dn;
        }

        switch ((int) $format) {
            case FILE_X509_DN_ARRAY:
                return $dn;
            case FILE_X509_DN_ASN1:
                $asn1 = new File_ASN1();
                $asn1->loadOIDs($this->oids);
                $filters = array();
                $filters['rdnSequence']['value'] = array('type' => FILE_ASN1_TYPE_UTF8_STRING);
                $asn1->loadFilters($filters);
                return $asn1->encodeDER($dn, $this->Name);
            case FILE_X509_DN_OPENSSL:
                $dn = $this->getDN(FILE_X509_DN_STRING, $dn);
                if ($dn === false) {
                    return false;
                }
                $attrs = preg_split('#((?:^|, *|/)[a-z][a-z0-9]*=)#i', $dn, -1, PREG_SPLIT_DELIM_CAPTURE);
                $dn = array();
                for ($i = 1; $i < count($attrs); $i += 2) {
                    $prop = trim($attrs[$i], ', =/');
                    $value = $attrs[$i + 1];
                    if (!isset($dn[$prop])) {
                        $dn[$prop] = $value;
                    } else {
                        $dn[$prop] = array_merge((array) $dn[$prop], array($value));
                    }
                }
                return $dn;
            case FILE_X509_DN_CANON:
                //  No SEQUENCE around RDNs and all string values normalized as
                // trimmed lowercase UTF-8 with all spacing  as one blank.
                $asn1 = new File_ASN1();
                $asn1->loadOIDs($this->oids);
                $filters = array();
                $filters['value'] = array('type' => FILE_ASN1_TYPE_UTF8_STRING);
                $asn1->loadFilters($filters);
                $result = '';
                foreach ($dn['rdnSequence'] as $rdn) {
                    foreach ($rdn as &$attr) {
                        if (is_array($attr['value'])) {
                            foreach ($attr['value'] as $type => $v) {
                                $type = array_search($type, $asn1->ANYmap, true);
                                if ($type !== false && isset($asn1->stringTypeSize[$type])) {
                                    $v = $asn1->convert($v, $type);
                                    if ($v !== false) {
                                        $v = preg_replace('/\s+/', ' ', $v);
                                        $attr['value'] = strtolower(trim($v));
                                        break;
                                    }
                                }
                            }
                        }
                    }
                    $result .= $asn1->encodeDER($rdn, $this->RelativeDistinguishedName);
                }
                return $result;
            case FILE_X509_DN_HASH:
                $dn = $this->getDN(FILE_X509_DN_CANON, $dn);
                if (!class_exists('Crypt_Hash')) {
                    require_once('Crypt/Hash.php');
                }
                $hash = new Crypt_Hash('sha1');
                $hash = $hash->hash($dn);
                extract(unpack('Vhash', $hash));
                return strtolower(bin2hex(pack('N', $hash)));
        }

        // Defaut is to return a string.
        $start = true;
        $output = '';
        $asn1 = new File_ASN1();
        foreach ($dn['rdnSequence'] as $field) {
            $prop = $field[0]['type'];
            $value = $field[0]['value'];

            $delim = ', ';
            switch ($prop) {
                case 'id-at-countryName':
                    $desc = 'C=';
                    break;
                case 'id-at-stateOrProvinceName':
                    $desc = 'ST=';
                    break;
                case 'id-at-organizationName':
                    $desc = 'O=';
                    break;
                case 'id-at-organizationalUnitName':
                    $desc = 'OU=';
                    break;
                case 'id-at-commonName':
                    $desc = 'CN=';
                    break;
                case 'id-at-localityName':
                    $desc = 'L=';
                    break;
                case 'id-at-surname':
                    $desc = 'SN=';
                    break;
                case 'id-at-uniqueIdentifier':
                    $delim = '/';
                    $desc = 'x500UniqueIdentifier=';
                    break;
                default:
                    $delim = '/';
                    $desc = preg_replace('#.+-([^-]+)$#', '$1',  $prop) . '=';
            }

            if (!$start) {
                $output.= $delim;
            }
            if (is_array($value)) {
                foreach ($value as $type => $v) {
                    $type = array_search($type, $asn1->ANYmap, true);
                    if ($type !== false && isset($asn1->stringTypeSize[$type])) {
                        $v = $asn1->convert($v, $type);
                        if ($v !== false) {
                            $value = $v;
                            break;
                        }
                    }
                }
                if (is_array($value)) {
                    $value = array_pop($value); // Always strip data type.
                }
            }
            $output.= $desc . $value;
            $start = false;
        }

        return $output;
    }
1043629
private function stringIsWrapped(&$inputString, $specialCharacterLeft = '[', $specialCharacterRight = ']')
    {
        $isWrapped = ($inputString[0] == $specialCharacterLeft && $inputString[mb_strlen($inputString) - 1] == $specialCharacterRight);

        $inputString = str_replace(array($specialCharacterLeft, $specialCharacterRight), '', $inputString);

        return $isWrapped;
    }
841565
function toBinaryString(arr) {
                var str = '';
                for (var i = 0; i < arr.length; i++) {
                    var obj = (arr[i] >>> 0).toString(2);
                    str += '00000000000000000000000000000000'.substr(obj.length) + obj;
                }
                return str;
            }
1177828
public function getcfg(){
		$str='//'.$this->name.PHP_EOL;
		$str.='define(\''.$this->alias.'\','.(int)$this->getVal().');'.PHP_EOL;
		return $str;
		}
1312669
function hiraganaToKatakana(str) {
  if (!hasKana(str)) {
    return str;
  }
  return str.split('').map(charCodeToKatakana).join('');
}
1150575
private function buildParametersString($parameters)
    {
        $parts = [];

        ksort($parameters);
        foreach ($parameters as $key => $val) {
            $parts[] = sprintf('%s=%s', $key, $val);
        }

        return implode('; ', $parts);
    }
88499
public function getMessageString()
    {
        $str = implode(' ', $this->header);
        if (count($this->structuredData)) {
            $str .= ' ' . implode('', $this->structuredData);
        } else {
            $str .= ' ' . self::NILVALUE;
        }
        $str .= ' ' . $this->msg;
        return $str;
    }
406921
protected function _toQuerystring($parameters) {
		$out = '';
		$keys = array_keys($parameters);
		$count = count($parameters);
		for ($i = 0; $i < $count; $i++) {
			$out .= $keys[$i] . '=' . $parameters[$keys[$i]];
			if ($i < $count - 1) {
				$out .= '&';
			}
		}
		return $out;
	}
1064018
public function getSortString() {
    $sort = $this->getSort();
    $sortString = array();
    if (is_array($sort) && !empty($sort)) {
      foreach ($sort as $k => $v) {
        $sortString[] = $v . $k;
      }
    }
    return implode(";", $sortString);
  }