acf_str_camel_case()ACF 5.8.0

acf_str_camel_case

Converts a string into camelCase. Thanks to https://stackoverflow.com/questions/31274782/convert-array-keys-from-underscore-case-to-camelcase-recursively

No Hooks.

Returns

String.

Usage

acf_str_camel_case( $string );
$string(string)
The string ot convert.
Default: ''

Changelog

Since 5.8.0 Introduced.

acf_str_camel_case() code ACF 6.8.8

function acf_str_camel_case( $string = '' ) {
	return lcfirst( str_replace( ' ', '', ucwords( str_replace( '_', ' ', $string ) ) ) );
}