You are here

function spam_range in Spam 5.3

Same name and namespace in other branches
  1. 6 spam.module \spam_range()

Support PHP4 which has no 'step' parameter in its range() function.

3 calls to spam_range()
node_age_admin_settings in filters/node_age/node_age.module
Module administrative configuration options.
spam_admin_filters in ./spam.module
spam_admin_settings_form in ./spam.module
Spam module settings form.

File

./spam.module, line 2011

Code

function spam_range($low, $high, $step = 1) {
  if (version_compare(phpversion(), '5') < 0) {

    // Emultate range with a step paramater for PHP4 users.
    $rng = array();
    for ($i = $low; $i <= $high; $i += $step) {
      $rng[] = $i;
    }
    return $rng;
  }
  else {
    return range($low, $high, $step);
  }
}