New param type: PARAM_NUMBER, for floating point numbers.

This commit is contained in:
tjhunt
2006-12-22 13:29:20 +00:00
parent 77ed3ba5fd
commit 9dae915acb
+8
View File
@@ -115,6 +115,11 @@ define('PARAM_INT', 0x0002);
*/
define('PARAM_INTEGER', 0x0002);
/**
* PARAM_NUMBER - a real/floating point number.
*/
define('PARAM_NUMBER', 0x000a);
/**
* PARAM_ALPHA - contains only english letters.
*/
@@ -363,6 +368,9 @@ function clean_param($param, $type) {
case PARAM_INT:
return (int)$param; // Convert to integer
case PARAM_NUMBER:
return (float)$param; // Convert to integer
case PARAM_ALPHA: // Remove everything not a-z
return eregi_replace('[^a-zA-Z]', '', $param);