bludit/kernel/helpers/valid.class.php

27 lines
424 B
PHP
Raw Normal View History

2015-08-04 05:10:12 +02:00
<?php defined('BLUDIT') or die('Bludit CMS.');
class Valid {
public static function ip($ip)
{
return filter_var($ip, FILTER_VALIDATE_IP);
}
public static function email($email)
{
return filter_var($email, FILTER_VALIDATE_EMAIL);
}
public static function int($int)
{
if($int === 0) {
return true;
}
elseif(filter_var($int, FILTER_VALIDATE_INT) === false ) {
return false;
}
return true;
}
}