3v4l.org

run code in 300+ PHP versions simultaneously
<?php function camelCase($string) { //preg_replace('/[^a-zA-Z0-9]/', '', ucwords(str_replace('/',' ',strtolower($string)))); //return preg_replace_callback('/\/[a-zA-Z9-0]/', function($matches){return strtoupper($matches[0][1]);}, $string); return preg_replace_callback('/\/[a-zA-Z9-0]/', function($matches){return ucword($matches[0]);}, $string); return $string; } echo camelCase('common/home');

preferences:
48.55 ms | 402 KiB | 5 Q