[Typo3] checkbox logic?! 10boxes in two rows

Georg Ringer spam at ringerge.org
Sat Dec 17 11:31:19 CET 2005


   // read the Checkboxes of record
   // $count = Number of checkboxes
   // $features = value of DB
   // $boxArr[$m] => values of checkboxes in array
   $count = $this->config['sizeCount'];
   $k = 1;
   $features = $row['size'];
   for ($m=0; $m < $count; $m++) {
    if ($features & $k) {
     $boxArr[$m]=1;
    } else {
     $boxArr[$m]=0;
    }
    $k *= 2;
   }

;)
georg 





More information about the TYPO3-english mailing list