"Numerieke stringwaarde" Afvang

From Edgar BV Wiki
Jump to navigation Jump to search
/**
 * This function returns true only when given positive integer or string that contains only digits
 * @link http://nl3.php.net/manual/en/function.ctype-digit.php (Comments)
 */
function isDigital($var){
		return ($var===0 || $var==='0' || (!empty($var) && (is_string($var) || is_int($var)) && ctype_digit((string) $var)));
}

function isFloat($var){
	return ($this->isDigital($var) || is_numeric($var));
}