0) { if (strlen(trim($currentValue)) < $min) { $hasError = true; } } if ($max > 0) { if (strlen(trim($currentValue)) > $max) { $hasError = true; } } if ($min == 0 && $max == 0) { if (strlen(trim($currentValue)) == 0) { $hasError = true; } } if (strlen(trim($currentValue)) == 0) { $hasError = true; } if ($requireItem == 'int') { if (is_numeric($currentValue) == false) { $hasError = true; } } if ($requireItem == 'numeric') { if (is_numeric($currentValue) == false) { $hasError = true; } } if ($hasError) { util::fail($message); } } } return $validPass; } }