- settype: documentation ( source)
- decbin: documentation ( source)
- implode: documentation ( source)
<?php
$cups = array();
for($i=0; $i<100; $i++){
$cups[$i] = 0;
}
for($x=1; $x<100; $x++){
for($y=$x; $y<100; $y+=$x){
$cups[$y] = !$cups[$y];
}
}
$selected = array();
foreach($cups as $key => $value){
if($value == 1){
$selected[] = $key;
}
}
$sel_str = implode(', ', $selected);
echo $sel_str;
echo "\n\n\n\n";
foreach ($selected as $num) {
settype($num, 'integer');
echo decbin($num)."\n";
}