You are here

function uif_is_natural in User Import Framework 7

Return TRUE if a $val is a natural number (integer 1, 2, 3, ...). Base can be changed to zero if desired.

1 call to uif_is_natural()
uif_get_taxonomy_value in ./uif.admin.inc
Helper function to process import data for core supported fields.

File

./uif.admin.inc, line 1049
Simple, extensible user import from a CSV file.

Code

function uif_is_natural($val, $base = 1) {
  if (!isset($val)) {
    return FALSE;
  }
  $return = (string) $val === (string) (int) $val;
  if ($return && intval($val) < $base) {
    $return = FALSE;
  }
  return $return;
}