You are here

function availability_calendar_booking_formlet_get_nested_array_value in Availability Calendars 7.3

Same name and namespace in other branches
  1. 7.5 booking_formlet/availability_calendar_booking_formlet.inc \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.module
Returns a date based on the settings and global context.

File

booking_formlet/availability_calendar_booking_formlet.module, line 682
Availability Calendar booking formlet module. This submdule of the Availability Calendar module defines a field that shows a small booking form that interacts with a calendar field. The form only has an arraival and departure date field and a submit…

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);
}