Hi Philip,

By definition, any string that does not contain
alpha-characters is numeric.  I mean, '123' is an
integer, if only because it isn't 'onetwothree', you
know?

Because if I do this:

$num1 = '123';
$num2 = '456';
$total = $num1 + $num2;
print($total);

the total is going to be 579.  You know?

I guess I'm not following you.  Maybe if you give me
the problem in context I can help.

-dj
--- Philip Olson <[EMAIL PROTECTED]> wrote:
> 
> Hi Daniel,
> 
> No, I mean if it's numeric, not neccesarily an
> integer.  As the following
> is numeric and not an integer but rather, a string :
> 
> 
>   $num = '123';
> 
> Anyone have an authoritative answer on this?  Like,
> something that would
> go in the manual as the official php3 is_numeric
> check?
> 
> Regards,
> Philip
> 
> 
> On Tue, 28 Aug 2001, daniel james wrote:
> 
> > do you mean, as in,
> > 
> > if !is_integer($var) {
> > print("$var is not an integer");
> > }
> > 
> > --- Philip Olson <[EMAIL PROTECTED]> wrote:
> > > hi friends,
> > > 
> > > Can someone post here "the" most efficient
> method to
> > > validate a variable
> > > as numeric?  I see a ton of hacks/ways in the
> manual
> > > user comments under
> > > is_int, is_integer and is_numeric and would like
> to
> > > see just one or two
> > > good solid ones.  And please, no regular
> expressions
> > > :)
> > > 
> > > Regards,
> > > Philip
> > > 
> > > 
> > > 
> > > 
> > > -- 
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
> > > [EMAIL PROTECTED]
> > > 
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Make international calls for as low as $.04/minute
> with Yahoo! Messenger
> > http://phonecard.yahoo.com/
> > 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to