|
Posted by Michael Winter on 11/16/27 11:30
On 27/10/2005 14:28, lkrubner@geocities.com wrote:
[snip]
> function checkForFloatingPoint($input=false) {
I don't really see how boolean false is a useful default value, or even
why you'd want a default argument for the input.
What is this function supposed to do? Exactly what pattern(s) are you
trying to match or test for? It's identifier suggests that it should
look for some aspect of a floating-point number (though it's not clear
what), yet your pattern allows integers as well.
> $pattern = "[-+]?([0-9]*\.[0-9]+|[0-9]+)";
You haven't included any delimiters. A forward slash, at both the start
and end of the pattern, is common.
> $match = preg_match (pattern, subject);
You haven't included the dollar ($) symbol before each identifier.
[snip]
Mike
Don't use tabs to indent. Tabs are usually rendered with the equivalent
of eight spaces, which is far too much when content is usually wrapped
at eighty characters, or less. Use spaces; preferably two.
--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Navigation:
[Reply to this message]
|