- var_dump: documentation ( source)
- end: documentation ( source)
<?php
$regions = [
'int' => 1,
'nl' => 2,
'be' => 4,
'us' => 8,
'as' => 16,
'za' => 32,
];
foreach ($regions as $region => $x) {
$list[$region] = $i = $x;
while (end($regions) * 2 - (++$i%$x?$i:$i+=$x) > 0)
$list[$region] .= ",$i";
}
var_dump($list);