function pet_is_natural in Previewable email templates 7
Same name and namespace in other branches
- 8.4 pet.module \pet_is_natural()
- 8 pet.module \pet_is_natural()
- 6 pet.admin.inc \pet_is_natural()
Return TRUE if a $val is a natural number (integer 1, 2, 3, ...). Base can be changed to zero if desired.
1 call to pet_is_natural()
- pet_user_form in includes/
pet.admin.inc - Multi-step form for previewing and sending a PET.
File
- includes/
pet.admin.inc, line 530 - Contains pages for creating, editing, and deleting previewable email templates (PETs).
Code
function pet_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;
}