note 30969 deleted from language.operators.bitwise by sniper
| From: | sniper@php.net | Date: | Mon, 13 Oct 2003 00:13:27 +0000 |
| Subject: | note 30969 deleted from language.operators.bitwise by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-58413@lists.php.net to get a copy of this message | ||
Note Submitter: npm@pla.net.py
----
This is a function to convert flags saved as integers, to a boolean array for easy comparison.
Might be helpful to someone.
You input the the base10 number and it will return an array with the boolean values.
function flags2array($dec){
$bits= Array();
$bin = decbin($dec);
for ($i==0; $i< (strlen($bin));$i++){
$bits[$i] = $bin{$i};
}
return $bits;
}
Nico