update page now

Voting

: min(seven, five)?
(Example: nine)

The Note You're Voting On

S?b.
21 years ago
A bitwise operators practical case :

<?php
    // We want to know the red, green and blue values of this color :
    $color = 0xFEA946 ;

    $red = $color >> 16 ;
    $green = ($color & 0x00FF00) >> 8 ;
    $blue = $color & 0x0000FF ;

    printf('Red : %X (%d), Green : %X (%d), Blue : %X (%d)',
        $red, $red, $green, $green, $blue, $blue) ;

    // Will display...
    // Red : FE (254), Green : A9 (169), Blue : 46 (70)
?>

<< Back to user notes page

To Top