You are here

function availability_calendar_booking_formlet_get_nested_array_value in Availability Calendars 7.5

Same name and namespace in other branches
  1. 7.3 booking_formlet/availability_calendar_booking_formlet.module \availability_calendar_booking_formlet_get_nested_array_value()
  2. 7.4 booking_formlet/availability_calendar_booking_formlet.module \availability_calendar_booking_formlet_get_nested_array_value()

Extracts a possibly multi-level key from an array.

Parameters

array $array: The array to extract the value from.

string $key: The key, something like 'key1' or key1[subkey1][subkey2].

Return value

null|mixed Null when the key does not exist, the value of the array entry otherwise.

1 call to availability_calendar_booking_formlet_get_nested_array_value()
availability_calendar_booking_formlet_extract_date in booking_formlet/availability_calendar_booking_formlet.inc
Returns a date based on the settings and global context.

File

booking_formlet/availability_calendar_booking_formlet.inc, line 730
General helper methods for Availability Calendar Booking formlet to make the .module file smaller:

Code

function availability_calendar_booking_formlet_get_nested_array_value($array, $key) {
  $keys = explode('[', str_replace(']', '', $key));
  return drupal_array_get_nested_value($array, $keys);
}