> <?php
> $num = 8;
> $num = decbin($num);
> echo "Number is $num<BR>";
> $num = $num << 1;
> echo "Shifted Number is $num";
> ?>

But you are using it wrong.  decbin() returns a string with a binary
pattern in it.  You can't shift a string.  You shift numbers.  If you
already know the decimal value of the number you want to shift you don't
have to do anything.  I suggested bindec() because I thought you wanted to
provide a binary representation of the number for some reason.


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