PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
If 0 is acceptable as well, then all positive floats, all negative floats, and 0 consist of the entire range of floats. Just check if the value is a float and leave it at that.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Not sure what you're doing. Just a guess that these are coming from a database or from a post operation? If so, they will always be a string and is_float() will always return false.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.