bitstoarray.php

Go to the documentation of this file.
00001 <?php
00017 function bitsToArray($num)
00018 {
00019     $output = array();
00020     $current = 1;
00021     $count = 0;
00022     while($current <= $num)
00023     {
00024         if($current & $num)
00025             $output[] = $current;
00026 
00027         $current = pow(2, ++$count);
00028     }
00029 
00030     return $output;
00031 }
00032 ?>

Generated on Wed Oct 25 03:13:32 2006 for LFSWorldParsingProviderFramework by  doxygen 1.4.6