PHP code example of pointybeard / helpers-functions-flags

1. Go to this page and download the library: Download pointybeard/helpers-functions-flags 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/ */

    

pointybeard / helpers-functions-flags example snippets




ointybeard\Helpers\Functions\Flags;

const FLAG_A = 0x0001;
const FLAG_B = 0x0002;
const FLAG_C = 0x0004;

$flags = FLAG_B | FLAG_C;

var_dump(Flags\is_flag_set($flags, FLAG_C));
// bool(true)

var_dump(Flags\is_flag_set($flags, FLAG_A));
// bool(false)