Convert a string to camelCase

@param string $str
@return string
541557
public static function toCamelCase(string $str): string
    {
        $str = trim($str);
        $fn = function($arg) {
            list($match, $char) = $arg;
            $ret = str_replace($char, "", $match);
            return strtoupper($ret);
        };
        return preg_replace_callback("~( |_|-){1,}[A-Za-z]~", $fn, $str);
    }
1041691
public static function convertQuotes($str)
    {

        $r = "/\[q(?:uote)?\](.*?)\[\/q(?:uote)?\]/is";
        while(preg_match($r, $str)){
            $str = preg_replace($r, '<blockquote class="quote"><p>\\1</p></blockquote>', $str);
        }

        return $str;
    }
779609
function camelcase(str) {
  if (!/[\s\W]/.test(str)) return str;
  if (str.length === 1) {
    return str.toLowerCase();
  }
  str = str.replace(/^[\W_]+|[\W_]+$/g, '').toLowerCase();
  return str.replace(/[\W_]+(\w|$)/g, function(_, ch) {
    return ch.toUpperCase();
  });
}
148330
private function generateModuleNameCase($str) {
	    $i = array("-","_");
	    $str = preg_replace('/([a-z])([A-Z])/', "$1 $2", $str);
	    $str = str_replace($i, ' ', $str);
	    $str = str_replace(' ', '', ucwords(strtolower($str)));
	    $str = strtolower(substr($str,0,1)).substr($str,1);
	    $str = ucfirst($str);
	    return $str;
	}
934819
public static function camelize($str)
    {
        $str = strtolower($str);
        $str = strtr($str, '_', ' ');
        $str = preg_replace('/\s+/', '', ucwords($str));

        return lcfirst($str);
    }
186785
public function clean_string($str)
    {
        if ($this->is_ascii($str) === FALSE) {
            if (MB_ENABLED) {
                $str = mb_convert_encoding($str, 'UTF-8', 'UTF-8');
            } elseif (ICONV_ENABLED) {
                $str = @iconv('UTF-8', 'UTF-8//IGNORE', $str);
            }
        }

        return $str;
    }
828492
public static function getString(&$str)
    {
        $p = mb_orig_strpos($str, "\x00");
        if ($p === false) {
            return '';
        }
        $r = mb_orig_substr($str, 0, $p);
        $str = mb_orig_substr($str, $p + 1);
        return $r;
    }
484968
static public function camelcasedToDashed($str) {
        $str = lcfirst($str);
        return preg_replace_callback(
            '/([A-Z])/',
            function ($str) {
                return "-" . strtolower($str[1]);
            },
            $str
        );
    }
864209
final protected function camelize($str)
    {
        if (strstr($str, '_') === false) {
            return $str;
        }
        return lcfirst(implode('', array_map('ucfirst', explode('_', $str))));
    }
1282834
private function underlineToUppercase($str)
    {
        $fnc = function ($matches) {
            return strtoupper($matches[1]);
        };
        $str = preg_replace_callback('/_+([a-z])/', $fnc, $str);
        return $str;
    }
802917
public function lettering($str)
  {
    $output = '';
    $array = str_split($str);
    $idx = 1;

    foreach ($array as $letter) {
      $output .= '<span class="char' . $idx++ . '">' . $letter . '</span>';
    }

    return $output;
  }
1324078
private function to_regex($str)
    {
        if ($str[0] == '/' && $str[strlen($str) - 1] == '/') {
            return $str;
        } else {
            return pakeGlobToRegex::glob_to_regex($str);
        }
    }
82468
public function widont($str) {
		$str = rtrim($str);
		$space = strrpos($str, ' ');

		if ($space !== false) {
			$str = substr($str, 0, $space) . '&nbsp;' . substr($str, $space + 1);
		}

		return $str;
	}
467593
public static function replaceRoman(string $str) : string
    {
        $str = self::strToArray($str);
        return implode('', self::replaceRomanArray($str));
    }
199318
public static function encode(String $str) : String
    {
        return str_replace(array_keys(self::$phpTagChars), array_values(self::$phpTagChars), $str);
    }
1029927
public static function camelTo_($str) {
        if (!is_string($str))
            return '';
        $str[0] = strtolower($str[0]);
        $func = create_function('$c', 'return "_" . strtolower($c[1]);');
        return preg_replace_callback('/([A-Z])/', $func, $str);
    }
1267198
public static function uppercase($str): string
    {
        if (!$str || !\is_string($str)) {
            return \is_int($str) ? $str : '';
        }

        if (\function_exists('mb_strtoupper')) {
            return \mb_strtoupper($str, 'utf-8');
        }

        return \strtoupper($str);
    }