function rooms_range in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7
Alternative numeric range generator considering users that use PHP < v5.3.6 and experiment the bug: https://bugs.php.net/bug.php?id=51894
Parameters
int $start: First value of the sequence.
int $end: The sequence is ended upon reaching the end value.
Return value
array The expected range.
2 calls to rooms_range()
- rooms_assoc_range in ./
rooms.module - Returns a range array keyed by value.
- rooms_booking_edit_form in modules/
rooms_booking/ rooms_booking.admin.inc - Form callback: create or edit a booking.
File
- ./
rooms.module, line 1110 - Provides basic underlying functionality and configuration options used by all Rooms modules
Code
function rooms_range($start, $end) {
if (version_compare(phpversion(), '5.3.6', '<')) {
$range = array();
for ($index = $start; $index <= $end; $index++) {
$range[] = $index;
}
return $range;
}
else {
return range($start, $end, 1);
}
}