function isChar($s) { return isLower($s) || isUpper($s); }
/** * Makes a case swapped version of the string * @param string $string the input string * @param boolean $mb to use or not to use multibyte character feature * @return string case swapped version of the input string * * @author Rod Elias <*****@*****.**> */ function swapCase($string, $mb = false) { return array_reduce(str_split($string), function ($carry, $item) use($mb) { return $carry .= isLower($item, $mb) ? toUpper($item, $mb) : toLower($item, $mb); }, ''); }