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!
Problem might be that you're trying to convert a string directly to a float. To really know what the problem is, we'd have to know what the actual value of $getposts is. Use var_dump() on it by itself.
The main reasons that floatval() returns zero is because there are non-numeric, non-whitespace characters at the beginning of the string ... or if the value is an array.