Another workaround to this problem is as an addition to Kirk Johnson's
suggestion....

--clip--
        $month = "08";
         if (trim($month) == 8) {
            echo "You got it!!!";
         }
--clip--
"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Aw nut!!!  The intval() doesn't work......  I had enough, I'm going to do
> what Kirk Johnson recommend.  That one work better.....
>
> "Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Yea, it's too bad that not many people know about it.  I first asked and
> > they told me it is done automatically.  That was 3 years ago.  I never
had
> a
> > problem for 3 years until now.  So, I'm going back to the old way as I
did
> > in Javascript and C programming.  I first started PHP 3 years ago, so
it's
> > no wonder why there's all the confusion when I was just an innocent
> victim.
> > :-)
> >
> > "Cal Evans" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > John.
> > >
> > > > Actually, "08" is equal to 8 in PHP. PHP will convert the string to
an
> > > >integer and the two will compare as equal.
> > >
> > > No they are not equal. Yes, PHP will do the conversion so that they
are
> > > equal. That does not refute the fact that logically '08' != 8.
> > >
> > >
> > > > Someone already posted why the problem was happening, because the
> > numbers
> > > > were being converted to invalid octal numbers and being set to zero.
> > >
> > > I understand the problem at hand. (and did when I posted) However, if
> > Scott
> > > had been doing the conversions manually, he would never have run
across
> > this
> > > problem.  It is a bad idea to rely on the language (whatever the
> language)
> > > to do automatic variable conversions.
> > >
> > > =C=
> > >
> >
> >
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to