split array into key and value
I want to do what foreach does, but without the iteration, because I know I only have one value.
Oh, maybe each()?
Side note: It appears that Drupal coding standards (at least several examples in core) call for a lowercase, not capitalized, "as" in
foreach ($array as $key => $value) {
...
}
I ended up using <code>$key = key($single_element_assoc_array);
And then getting the value with $value = $single_element_assoc_array[$key];
split array into key and value
I want to do what foreach does, but without the iteration, because I know I only have one value.
Oh, maybe each()?
Side note: It appears that Drupal coding standards (at least several examples in core) call for a lowercase, not capitalized, "as" in
foreach ($array as $key => $value) {
...
}
I ended up using <code>$key = key($single_element_assoc_array);
And then getting the value with $value = $single_element_assoc_array[$key];