Are there any best practices for handling numerical input validation in PHP, especially for decimal numbers?

When handling numerical input validation in PHP, especially for decimal numbers, it is important to check if the input is a valid decimal number and meets any specific criteria (such as maximum or minimum values, number of decimal places, etc.). One common approach is to use PHP's built-in functions like is_numeric() or filter_var() with FILTER_VALIDATE_FLOAT to validate decimal numbers.

// Example of validating a decimal number input in PHP
$input = "3.14";

if (filter_var($input, FILTER_VALIDATE_FLOAT)) {
    echo "Input is a valid decimal number.";
} else {
    echo "Input is not a valid decimal number.";
}