Last active
January 21, 2017 14:48
-
-
Save d30jeff/197d6e7612a69bc08ca055443979fd1e to your computer and use it in GitHub Desktop.
256 128 etc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$number = 256; | |
$arr = []; | |
while($number > 0) { | |
$arr[] = $number; | |
$number = $number >> 1; | |
} | |
foreach (array_chunk($arr, 3) as $num) { | |
echo "{$num[0]} | {$num[1]} | {$num[2]} \n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment