PHP code example of semisedlak / bitmasking

1. Go to this page and download the library: Download semisedlak/bitmasking library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

semisedlak / bitmasking example snippets


const BIT_1 = 1; // 1 << 0
const BIT_2 = 2; // 1 << 1
const BIT_3 = 4; // 1 << 2
const BIT_4 = 8; // 1 << 3
const BIT_5 = 16; // 1 << 4

const BIT_ALL = BIT_1 | BIT_2 | BIT_3 | BIT_4 | BIT_5;