Automattic\WooCommerce\Blueprint
Util::snake_to_camel
Convert a string from snake_case to camelCase.
Метод класса: Util{}
Хуков нет.
Возвращает
string.
Использование
$result = Util::snake_to_camel( $string_to_convert );
- $string_to_convert(строка) (обязательный)
- The string to be converted.
Код Util::snake_to_camel() Util::snake to camel WC 11.2.2
public static function snake_to_camel( $string_to_convert ) {
// Split the string by underscores.
$words = explode( '_', $string_to_convert );
// Capitalize the first letter of each word.
$words = array_map( 'ucfirst', $words );
// Join the words back together.
return implode( '', $words );
}