[TYPO3-dev] Get value bits from checkbox array

Stefan Frömken firma at sfroemken.de
Tue Jun 15 07:45:27 CEST 2010


Jigal van Hemert schrieb:
> Stefan Frömken wrote:
>> if($thisValue&pow(2,$c))...
> 
> if $c >= 1 then I'd do something like
> 
> $thisValue & (1 << ($c-1))
> 
> or
> 
> (($thisValue >> ($c-1)) & 1)
> 
> Bitwise shifting operators are a bit faster that pow()
> 

That's really cool. I just found some samples in one of my books about 
it. binary division and multiplication. That's something for keep in 
mind. Thanks.




More information about the TYPO3-dev mailing list