We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
改 app里kebab2camel方法中正则表达式 /-([a-z]+)/ 为 /_-/
public static function kebab2camel($name, bool $big = true) { $name = preg_replace_callback('/-([a-z]+)/', function($m) { return ucfirst($m[1]); }, $name); return $big ? ucfirst($name) : $name; }
The text was updated successfully, but these errors were encountered:
上面正则被改变了看图
Sorry, something went wrong.
上述方法没想到action,以下方法解决 public static function kebab2camel($name, bool $big = true) { if ($big) { $name = preg_replace_callback('/_-/', function ($m) { return ucfirst($m[1]); }, $name); } else { $name = strtolower(preg_replace('/(.)(?=[A-Z])/u', '$1' . '_', $name)); } return $big ? ucfirst($name) : $name; }
No branches or pull requests
改 app里kebab2camel方法中正则表达式 /-([a-z]+)/ 为 /_-/
public static function kebab2camel($name, bool $big = true)
{
$name = preg_replace_callback('/-([a-z]+)/', function($m) {
return ucfirst($m[1]);
}, $name);
return $big ? ucfirst($name) : $name;
}
The text was updated successfully, but these errors were encountered: