note 30969 added to language.operators.bitwise
| From: | npm at pla dot net dot py | Date: | Fri, 04 Apr 2003 19:17:34 +0000 |
| Subject: | note 30969 added to language.operators.bitwise | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-46232@lists.php.net to get a copy of this message | ||
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
--
http://www.php.net/manual/en/language.operators.bitwise.php
http://master.php.net/manage/user-notes.php?action=edit+30969
http://master.php.net/manage/user-notes.php?action=delete+30969
http://master.php.net/manage/user-notes.php?action=reject+30969