Last active
June 25, 2025 11:50
-
-
Save CodeMan99/0c6ae060b2667af2d0fa967893c25c50 to your computer and use it in GitHub Desktop.
Excel columns letters using LazyCollection
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 | |
use Illuminate\Support\LazyCollection; | |
$columns = LazyCollection::make(function() { | |
yield $i = 1 => $c = 'A'; | |
while (true) { | |
yield ++$i => $c = str_increment($c); | |
} | |
}); | |
$columnIndexes = $columns->flip(); | |
dump([...$columns->skip(51)->take(17)]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment