What alternative PHP functions can be used for more precise validation of numerical input, such as FILTER_VALIDATE_FLOAT?

When validating numerical input in PHP, the FILTER_VALIDATE_FLOAT filter can be used to check if a value is a floating-point number. However, if more precise validation is required, other PHP functions can be used such as is_numeric() or a regular expression to ensure that the input meets specific requirements.

// Alternative PHP functions for more precise validation of numerical input
$input = "3.14";

// Using is_numeric() function
if (is_numeric($input)) {
    echo "Input is a valid numeric value.";
} else {
    echo "Input is not a valid numeric value.";
}

// Using regular expression
if (preg_match("/^-?\d*\.?\d+$/", $input)) {
    echo "Input is a valid floating-point number.";
} else {
    echo "Input is not a valid floating-point number.";
}