note 15547 modified in function.bindec by zak
| From: | zak@php.net | Date: | Mon, 17 Sep 2001 00:45:50 +0000 |
| Subject: | note 15547 modified in function.bindec by zak | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-18073@lists.php.net to get a copy of this message | ||
[Editor's Note:
Numeric values starting with 0 are interpreted as octal (base eight) values. For example: 0101 is
converts to 65
--zak@php.net]
i was quite confused while werking with those bindec()/decbin() functions..
while
echo decbin(bindec(1));
echo decbin(bindec(10));
echo decbin(bindec(101));
just worked like expected,
echo decbin(bindec(010));
returns just 0
and for any reason
echo decbin(bindec(010010010));
returns 101000
i dont think this is a bug (maybe theres some special reason 4 this?), but it took a certain time
till i noticed that
echo decbin(bindec("010010010"));
works fine ...
hope this helps ne1.
http://www.php.net/manual/en/function.bindec.php