$value = 3.14; if(is_float($value)){ echo "Value is a float"; } else { echo "Value is not a float"; }
$value = "Hello world"; if(is_float($value)){ echo "Value is a float"; } else { echo "Value is not a float"; }Output: Value is not a float This function is a built-in PHP function and does not require any additional packages or libraries.