Converts string keys to array keys.
There are three conventions for data keys in use. This function accepts each of it an ensures a array of keys.
array|string $key: The key can be either be an array containing the keys of a nested array hierarchy path or a string with '][' or '|' as delimiter.
array Array of keys.
public function ensureArrayKey($key) {
if (empty($key)) {
return array();
}
if (!is_array($key)) {
if (strstr($key, '|')) {
$key = str_replace('|', static::TMGMT_ARRAY_DELIMITER, $key);
}
$key = explode(static::TMGMT_ARRAY_DELIMITER, $key);
}
return $key;
}