wordpress/wp-content/themes/basic/themify/themify-utils.php
/**
 * Convert array key name with square bracket to valid array
 * @param array $inputArr
 * @return array
 */
Convert array key name with square bracket to valid array
@param array $inputArr
@return array
Convert array key name with square bracket to valid array @param array $inputArr @return array
function themify_convert_brackets_string_to_arrays( $inputArr ) {
	$result = array();
	foreach ($inputArr as $key => $val) {
		$keyParts = preg_split('/[\[\]]+/', $key, -1, PREG_SPLIT_NO_EMPTY);
		$ref = &$result;
		while ($keyParts) {
				$part = array_shift($keyParts);
			if ( !isset($ref[$part]) && is_array( $ref )) {
				$ref[$part] = array();
			}
			if ( is_array( $ref ) ) {
				$ref = &$ref[$part];
			}
		}
		$ref = $val;
	}
	return $result;
}
function themify_convert_brackets_string_to_arrays ( $ inputArr ) { $ result = array ( ) ; foreach ( $ inputArr as $ key => $ val ) { $ keyParts = preg_split ( '/[\[\]]+/' , $ key , - 1 , PREG_SPLIT_NO_EMPTY ) ; $ ref = & $ result ; while ( $ keyParts ) { $ part = array_shift ( $ keyParts ) ; if ( ! isset ( $ ref [ $ part ] ) && is_array ( $ ref ) ) { $ ref [ $ part ] = array ( ) ; } if ( is_array ( $ ref ) ) { $ ref = & $ ref [ $ part ] ; } } $ ref = $ val ; } return $ result ; }
Convert array key name with square bracket to valid array
 @param array $inputArr
 @return array
Convert array key name with square bracket to valid array @param array $inputArr @return array