Possible Duplicate:
Reference - What does this symbol mean in PHP?
What does this line do?
$theVal = ((($theR << 8) | $theG) << 8) | $theB;
What do the <<
and |
do?
Possible Duplicate:
Reference - What does this symbol mean in PHP?
What does this line do?
$theVal = ((($theR << 8) | $theG) << 8) | $theB;
What do the <<
and |
do?
Those are Bitwise operators that allow evaluation and manipulation of specific bits within an integer.
$a | $b Or Bits that are set in either $a or $b are set.
$a << $b Shift left Shift the bits of $a $b steps to the left (each step means "multiply by two")
$a >> $b Shift right Shift the bits of $a $b steps to the right (each step means "divide by two")
The literal answer can be found by reading about Bitwise Operators.
Practically speaking, it converts 3 values for Red, Blue and Green bytes into a single 24bit RGB value.