-- Forwarded message --
From: sean greenslade <[EMAIL PROTECTED]>
Date: Fri, Oct 31, 2008 at 11:22 PM
Subject: Re: [PHP] Bitwise operation giving wrong results
To: Yeti <[EMAIL PROTECTED]>
Cool, thanks. It worked. I didn't know you typeset PHP like that.
On Thu
Usually in PHP one does not take much care about the data types, but
in this case you absoloodle have to.
If you use bit operators on a character then its ascii number will be
taken instead (how should a number based operation work with a
string?)
also if you pass on $_GET params directly into ay
Ashley Sheridan wrote:
On Wed, 2008-10-29 at 20:01 -0400, sean greenslade wrote:
I have the following code as a test:
if I set a to 15 and b to 2 in the URL like so:
test.php?a=15&b=2
it outputs zero as the answer. When I run the hard-coded '&' operation (the
commented out echo), it returns
On Wed, 2008-10-29 at 20:01 -0400, sean greenslade wrote:
> I have the following code as a test:
> $a = $_GET['a'];
> $b = $_GET['b'];
> echo $a . " & " . $b . " = ";
> $out = $a & $b;
> echo $out;
> //echo 15 & 2;
> ?>
>
> if I set a to 15 and b to 2 in the URL like so:
>
> test.php?a=15&b=2
>
I have the following code as a test:
if I set a to 15 and b to 2 in the URL like so:
test.php?a=15&b=2
it outputs zero as the answer. When I run the hard-coded '&' operation (the
commented out echo), it returns 2. I'm stumped.
--
--Zootboy
5 matches
Mail list logo