public static function valid($value, $type)
{
if ($type == 'float')
{
$tmpval = $value;
$value = (real) str_replace(',', '.', $value);
($tmpval != 0 && $value == '0') ? $value = null : '';
}
else if ($type == 'int' || $type == 'table')
{
$value = (int) str_replace(',', '.', $value);
}
else
$value = "$value";
return $value;
}
public static function valid($value, $type)
{
if ($type == 'float')
{
if($value != floatval($value)) return null;
}
else if ($type == 'int' || $type == 'table')
{
return intval($value);
}
else
return $value;
}